There are valid reasons to fully hide courses from students, such as the child courses that feed into a metacourse. But there are also valid reasons to disable course access to a student but still show that they are enrolled in it. For example, restored courses often get hidden while faculty update them. And students frequently email IT support asking if they are registered for a course because they can't see it in their list of Moodle courses.
I am recommending a third option in the Visibility settings for a course that would allow a course to be set as hidden but the name of the course would be unlinked text so that students would see that they are enrolled in the course.
The new Visibility options would look like this:
Inaccessible is the new option.