No, we don't ask people to reveal their gender, and I speculate that we never would. Quite honestly from a security perspective alone, the less we know about you personally, the better we both are. If you think about the principle of least privilege, it makes sense from an information standpoint too.
From a perspective of understanding organizations in general, and how your efforts to attract the most diverse group possible might be panning out, it is useful to know this type of thing. But we don't need to ask you for it when we can do an analysis on a subset of our data where we can be at least 95% certain that we're sure of the user's gender, run reports on how people interact with the site and what seems to make them leave, and then continue iterating based on what we learn.
But that's just a matter of looking at email addresses to see if we can figure out with high certainty if you're a male or female, or seeing if the email is associated with a social profile that indicates gender. But we'd never store this information outside of a temporary table that's used to associate posts to gender instead of posts to users, which is still completely anonymous, and vanishes once the query runs.
And, well, there's the argument that knowing the subset of your users that well might lead to more bias that you were trying to eliminate in the first place. So it's better if the only thing that knows it is a temporary table in the database server, and that it's only your best guess to begin with.
But that's just doing research into how you're serving people well, or not so well, and why, and what might make it better. From that research, you can work on broader initiatives such as changes to user experience to encourage or discourage certain behaviors, etc.
What's better is just listening to people that feel unwelcome due to things that people are saying, understanding what those things look like and deciding if you should try to make a change in the user experience (UX / Software), culture (Community Growth) or both.
Then, constantly ask these people if it's getting better, staying the same, or getting worse, and adapt.
code like:
if (gender.IsMale()) {
// show something
} else if {
// do something
} else {
// this should never be reached
}
... well you can see that doesn't scale based on engineering principles alone, along with it being a horrible idea. So it's better to look at all of the causes, even those you have zero direct control over, and see what you can do working backwards from there.
And, well, do your diligence by listening and running numbers and finding out what they mean to see if you have a problem. And if you do, or even think you do, work on it before it becomes much bigger than you'd like, which we unfortunately didn't do.