This isn't meant to sound goady but I'm genuinely curious what the statistics are for the number of solo female travellers assaulted in their hotel rooms by complete strangers (ie nobody they knew personally or would have known they were staying there).
It feels like everyone is terrified of hotel rooms and make them sound like the most dangerous places ever. Yes, housekeeping or other guests may stumble inside or attempt to open the wrong door by accident but these aren't criminals by default. The nature of a hotel where hundreds of humans are staying in close proxity to each other means room mixups will happen. It would be psychologically abnormal for a normal person looking for their own room to suddenly decide to commit rape just because they happened to enter the wrong door where a woman was staying.
Many stories of "someone tried to open my door" and "someone entered my room by accident" come with the subtext that they escaped sexual assault by a hair. But if it was an honest mixup of keycards, why would another hotel guest who simply wanted to go back to his room even consider assaulting another guest? That person was probably equally mortified to stumble into a stranger's room.
The design of a hotel is also completely anonymous. So if you make sure that nobody sees you enter and exit the room, and don't make unnecessary small talk with other guests, then who would know there's a single female staying there? As a male hotel guest, it would be ridiculous to contemplate assault as all your details and ID are on file. Hotels have CCTV and it would be the easiest job in the world for police to compile a list of suspects.
As a frequently solo female traveller, I actually feel safer inside hotels because of the anonymity. Literally nobody knows who's behind any of the doors. As long as you take basic precautions like making sure nobody sees you enter the room and locking the door from the inside. The genuine risks of solo travel would be people who know you personally. Work colleagues, friends of friends, dating partners, social media followers who know exactly that you're alone in the city and also where you're staying.
I don't recall a single high-profile case in the media about a traveller who was assaulted by in a hotel room by a complete stranger (also whilst alone in the room to begin with, so not including cases were someone was invited back to the hotel). Happy to stand corrected, but I think it's just something that doesn't happen very often, if at all.