Someone wearing weird 3D printed camera glasses is going to be obvious. Someone with the skill to disassemble a tiny glued together smart glass frame, bypass any hardware protections, and flash a custom OS will be rare, and they’ll get caught anyway when they “accidentally” wander into the women’s locker for the third time.
So yeah, I guess as long as you're okay with a law like that potentially becoming very easy to bypass then I don't have a problem with it. But I think once things start going down that path, most people aren't going to be satisfied with leaving it at that; they'll hear about a bypass and start pushing to restrict the freedoms that enabled it.