Home schooling is not a suitable alternative IMO. Social contact with your peers is important too; having to forfeit that just to not be in a prison-like system seems like a bad deal.
> Choose some good coding/math/philosophy puzzles during the evening and work on them instead of paying attention in class
So in addition to wasting 8 hours per day in class you need to do extra work in the evening?
I think in both cases we need to fix the system instead of putting the burden onto students to put up with it or work around it with the solutions that you describe.