A brilliant theory has just come to me, which you are all welcome to pick holes in.
Perhaps in the past it was easier to be an autistic boy and more difficult to be an autistic girl
And more difficult to be an ADHD boy but easier to be an ADHD girl?
Reasoning: men were/ are expected to be poor at communications, "emotions" etc, and a lot of accommodations were unconsciously made for them ("don't disturb your father!" etc etc). There were a lot of typically "man" jobs available (engineering, working with figures etc). It was considered completely normal for men to have intense solitary hobbies (Although trainspotters have always been the butt of jokes to be fair!)
Meanwhile women were expected to be the nurturers, the child raisers, the communicators and emotional smoother- overs and the ones making the accommodations. No wonder so many people report their suspected autistic mums as being cold, weird and unhappy during their childhoods. And why so many women are seeking a diagnosis in middle age.
Meanwhile, disruptive boys were getting literally battered (I witnessed my Y5 teacher literally dragging the class troublemaker out of the room by his ear), told they were useless, getting kicked out of school and left to rot as teenage impulsiveness kicked in, getting into trouble and frequently ending up on the prison merry-go-round.
While their female ADHD peers- typically less hyperactive- would coast through, quietly failing, sometimes indulging their impulsive side in risky sexual behaviour as teens, but with a clear future ahead of them as slightly scatty wives and mums.
I'm sure I'm generalising a lot here though.