The question has always struck me as so passively aggressive and unnecessary. They might not have used the bathroom at lunch. Then again they might have used it and now they have to use it again. Or here’s a crazy idea- they didn’t have to use it then but they have to use it now. What difference does it make? You have two choices- let them go to the bathroom to use the bathroom- or make them use the bathroom in class. The latter one could be quite embarrassing and Legally questionable- certainly could be a risky career move. But even asking a kid- say one with IBD or UTI etc can be embarrassing and violate policies. Those things aren’t the business of the entire class.
*groan" "MAY I go to the bathroom?"