Everyone should learn SOS in Morse Code. Random banging on a pipe is obviously not very effective.
Door hinges are usually on the inside; a flathead screwdriver might be useful, but easier than that is to not lock the door. What’s the point, when no one else is around?
From what I’ve seen of French bathrooms on House Hunters, there probably wasn’t room to swing a tank lid, if there were a tank lid to swing. Some French toilets are tankless.
“Some French toilets are tankless.”
Some are just a hole in the floor.