I fear we have all a local and context dependent ethnomethod to get rid of the rigidity implied in old deprecated get_course_students(...). These methods still are very usefull user status queries that are involved in many module scenarii.
I suggest H.Q. and core designers rehabilitate such functions, letting have the restricted meaning they will have. My question about moodle/legacy:student role wasn't so ingenuous : could'nt we status that this capability could map any role with student-like responsibilities to any custom role ? So could get_course_student be implemented a very simple way : checking availability of moodle/legacy:student in this course context and retreiving all users will have such condition verified. We could ensure ascendent portability of major code sections without bothering with such upgrades to follow.
NB : such a solution for all legacy roles, indeed !