2: You make it a school sponsored function. Teachers walk their students outside/somewhere. Let them chant some school approved chants a bit. Basically turn it into a pep rally at the risk of students finding it shallow and still walking out.
I think (and remember, not a constitutional lawyer) this would go against Tinker v. Des Moines. Unless you could prove ahead of time that they were going to be walking out and thus disrupting education. But to do that, you'd have to let them walk out.
Tinker ONLY applies to free speech insofar as it doesn't interfere in the normal operation of school.
Something as innocuous as an arm band is just about the ONLY thing that protects.
Post-Tinker, several cases have come up that have cut down on the extent to which Tinker protects students speech.
A class walk out, especially mass and organized is 100% interfering with school function. You might not be able to force kids to take a political side on that issue, but you can enforce that they must say it in a respectful and organized manner.
You can argue that the existing law/precedent is vague on these matters, because they are. But you can't say the kids would be 100% protected. Fighting it would very likely end up in court where a judge would very much have freedom to rule against the kids free speech in this instance.