No problem, I thought: this happens sometimes with the ground floor bathroom, and I just poke a screwdriver or Allen wrench into the small hole on the faceplate to release the lock. But, there was a problem: when I did so with the upstairs bathroom, the Allen wrench met no resistance, just empty air.
I disassembled the main-floor bathroom lock and determined that there are two ways to reassemble the two halves of the lock. The intended orientation permits the door to be unlocked from the outside, because the hole in the outside faceplate aligns with the lock release mechanism. If you rotate the outside half of the lock upside-down before screwing the two halves together, then there are baffles that prevent access to the lock mechanism. I took off the outside knob and faceplate of the upstairs lock, and I could see the ends of the screws: the lock had been assembled with the screw heads on the inside, so I couldn't disassemble the lock.
The door opens in, so I couldn't just remove the hinges.
A molding and a firm door fit prevented using a credit card, or even a more flexible card, to card open the door.
I could not pick the lock, because there is no keyhole.
Eventually, I did what MacGyver would have done: I opened the door with a piece of paper, dental floss, and an extension cord. I tied the floss to the paper, slipped the paper over the top of the door, and lowered it to the bottom of the door where a half-inch gap let me retrieve the paper. Now, the floss was running from the top of the door to the bottom, on the inside, while I controlled the ends from the outside. I untied the floss from the paper and tied it to the middle of the extension cord. I fed the extension cord under the door, making a loop on the inside of the bathroom (with the floss tied to the middle of that loop). Then I yanked up on the floss, which looped the extension cord over the handle. By pulling on the cord, I could turn the handle, which unlocked the door.
As soon as the door was open, I disassembled and reassembled the lock so that next time I can easily unlock it from the outside with a screwdriver or Allen wrench.
(A tip of the hat to hakzorz at Instructables for the idea.)