> Now we are almost at the point of making not going to school illegal.
I'm fairly certain (at least for the US) it has been illegal. "By 1918, every state had a compulsory attendance law on the books." [1]
According to this table, school attendance is compulsory for every state in the US for specific age ranges: https://nces.ed.gov/programs/statereform/tab5_1.asp
[1] https://hslda.org/content/docs/nche/Issues/S/State_Compulsor...