Perhaps every student can be assigned a monitor to take them to the restroom.
Unless the monitor can't be trusted. Then the monitor will be assigned a monitor.
Or maybe we can do without walls around restrooms so everyone can monitor what's going on.
There are endless solutions we can implement.