If I were paying for advertising for a software engineering position I'd get much better ROI by excluding women and older demographics simply because they're much less likely to be suitable for the job, statistically speaking, when we're talking about the wider population in general and not just software engineers.I think your logic is flawed. What you are not taking into account is that when you advertise, you ask people to do a certain amount of self-selection. If you advertise that you need a Go programmer, it's not like you have to work really hard to only advertise to Go programmers for fear that you will get 1,000,000 resumés from Java programmers.
And even if you did, you can throw out all those resumés cheaply, because they don't have Go experience on them. The big costs in hiring are the cost of showing ads to people, or even the cost of sorting through resumés.
The big costs of hiring are 1. Interviewing people, and 2. The opportunity cost of not finding the right person as soon as possible.
Not advertising to women because you have a theory that there are fewer qualified women out of the entire population of women than there are qualified men out of the entire population of men is premature optimization.
If, for example, you are advertising to Hacker News people, do you really think that the statistics about women in general are relevant? Or perhaps those women who read Hacker News are not representative of women in general?
Same for if you advertise to people who have shown an interest in Go, or Elixir, or Lisp, or distributed system, or DevOps. If you were advertising for people with experience programming for space flight in 1971, there might have only been a dozen women in America with relevant experience.
What kind of logic leads you to say, "Forget it, I am not interested in hearing from Margaret Hamilton, because there are so many women who actually have experience as secretaries?"
I have said this many times before, but when you are seeking exceptional people, people who are actually very rarely available and have many opportunities to choose from, the overall statistics are irrelevant. If out of 10,000 people on Hacker News there are four men you would hire, and only one woman, this is no time too think, "my ads get four times the efficiency if I only advertise to men."
Instead, you should be thinking, "There are only .05% of the readers that I want to hire. If I advertise to both men and women, I increase the chance of finding one of those .05% by a whopping 25%!"
If hiring is easy, that may not matter. But if hiring is hard, if you might make several offers and only get one person to accept, if you might go a month before finding the ideal candidate... You want to advertise far and wide, and use other methods to filter out spammy submissions.
Advertising is cheap. Not being able to hire the right person at that magical moment when they are available is very expensive.