This makes me wonder whether we can actually know the extent of the imbalance – and the extent necessarily changes how it’s addressed. I wonder if it would be worthwhile having an opt-in anonymous gender field, with details only available in aggregate to community leaders. This would need very clear messaging around its use, and strong safeguards to prevent misuse.
(Aside: technically, you could implement this by having a “has stated gender flag” on the user table, with a separate table storing counts of each. This wouldn’t be completely bullet-proof against log-matching attacks (or looking across backups), but those approaches would be tough and inconclusive – and if your site admin is doing that sort of thing, you have much bigger problems than a gender imbalance, in my view.)
One approach that could work would be to enforce a “real name” policy – Facebook and Google attempted this, but it opened a whole different can of worms, resulting in further marginalisation of some smaller groups. I’m not convinced that this is a good idea.
I would imagine that one of the big things would be to demonstrate inclusivity, and show that misogynistic, predatory, and other inappropriate behaviours will not be tolerated – as @itsbhanusharma noted. As Twitter has shown us, this can sometimes mean that a female community leader needs to act as a “sacrifical anode” – receiving all the nasty behaviour but calling it out (along with other leaders in the community). This seems to be one of the few ways that can actually effect change, because there is a genuine impact on the malefactor, but the emotional and psychological strain it must place on those people, over and above what they already deal with, is awful, and I would hate to put that burden on someone, or expect them to shoulder it.
If gender were disclosed at sign-up, you could look at some sort of invite-based badge for helping to build a balanced community – inviting a similar number of active female and male contributors. But disclosing gender online isn’t something that people will “just do”, so – as with my first suggestion around aggregate stats – there would have to be clear messaging around the data’s use and safeguards to prevent its misuse. Even so, I’d anticipate very low response rates.