In my town all elementary school students play recorder and get some basic music and music history knowledge. This is mandatory, but fun class. I have not heard of any kid who would not enjoy it.
When they move to middle school they can continue music education only if they want to - they are offered two orchestra groups (beginner and intermediate - both offer woodwinds, brass, and percussion), and two choruses. All willing students can join the beginner group at any school grade 5-8, and can advance to intermediate next year if they want and can, or can stay with beginners. Of course those who are already good enough (say took out of school classes) will be accepted to intermediate orchestra and/or chorus by audition right away.
Same in the high school - chamber chorus, jazz band, marching band, orchestra - only if they want to take these graded classes (grades are based on participation and effort, of course, not on how talented they are.
Jazz band expects that students already know how to play, and is considered advanced class by audition only.
Our schools do not offer keyboard and guitar because these classes would require personal education.
I'd say any young student should be allowed to not learn music if they do not want to. Otherwise they may develop negative attitude to it which may prevent them from possible joyful musical experience later in their life.
Both my kids played trumpet in middle school, and had fun. Older son also sang in chorus until high school graduation. Not because they had to, but because they liked it.
They both also tried classical guitar, electric guitar, piano classes out of school, and older son also took drums. As long as they wanted, not longer. IMHO, music is not for tiger moms and their kids.