Have you considered determining NPC gender randomly?
At some point in the past, I noticed that I had a strong tendency to make NPCs male, even though there wasn't any good story or setting-specific reason to do so. From gods to villains to random shopkeepers - most of these were assigned male without me even realizing that I have been doing it.
Thus, I started to assign genders by the roll of a dice - and I am fairly pleased with the results as this made the world significantly more diverse.
How about you? Have you noticed any similar biases in your own NPCs - and if so, what did you do about this?
I am no fan of random generation, but I try to have a proper gender balance, and found that gender swapping cliché is a good way to re-use them, the stupid prince worried about his hair, the lady knight
My thoughts is make the characters first there backstory and everything then roll for gender, as if I did gender first I would feel like I draw more towards stereotype of that gender. As one gender does not define who someone is. And this way they all seem more diverse and more alive that way.
I'm currently GMing Cyberpunk (because I can't convince my group to play Shadowrun), and there are a couple of modules that use gender politics as part of their hook and background. I don't want to mess with those because I feel like it adds to the credibility of the world.
Overall, I tend to make mostly female NPCs. To avoid that, I assign gender based on who they will appear with. If the leader of a faction is female, their sidekick is male. When male driver 1 passes the group to driver 2, driver 2 is female.
I did this in a novel I wrote, actually. I assigned TLA 'names' based on their job (ENG, PIL, etc), and any time a gender would normally be referenced in the text I used XXX - both for easy searching. I got about 70% of the way through when my beta readers rebelled - they absolutely HAD TO KNOW what gender everybody was. Sigh.
But by this time the characters' personalities and speech patterns were well established, so I flipped a coin for each one, and continued onward. I'll probably do this again some day and just ignore the beta readers.