Scott Alexander mentions this in the context of Failures Vs Tradeoffs in understanding mental illness. To short version is that nearly everything that is different in the brain is a failure of some system or part of a system. Tradeoffs that work are unusual. However, they do exist, largely because a specific disability is an advantage in a narrow range of contexts, but those contexts exist and are important in a culture.
And yet there are clear signs that other autism risk genes are associated with intelligence, and some of these are even positively selected. My guess is that these involve a tradeoff. I don't know exactly what this tradeoff is, but I tend to go with Lawson, Rees, and Friston’s speculation that autistic brains think with higher precision. This lets them think more precisely when that would be useful, but it also means they're constantly getting false negatives (ie not recognizing a person's face if the shadows on it are slightly different), constantly having their attention hijacked by minor stimuli that the rest of us would ignore (sensitivities to stimuli very slightly different from expected stimuli, like the dripping of water or the feeling of the tag on their shirt), and constantly getting confused by minimal deviations from routine. And although it's less obvious, some people have speculated that this makes it harder to do the sort of intuitive categorization work that lets you draw conclusions from social situations.
My guess is that somebody who's chosen the far end of this tradeoff naturally ends up as the stereotypical "aspie engineer", who's very smart, a bit off, but not so far gone he can't hold down his job at Google.
I have been thinking about my own clear Aspergery self lately, and noting how I have always gravitated toward others with some version of ASD. The Wikipedia article is quite good, and mentioned things I had never quite picked up before in my contemplation, such as poor coordination (I always said I had to work twice as hard to be half as good as a guitarist, and my handwriting has always been terrible in ways that look childish), preference for nonfiction, and the common poor understanding of reciprocity by many Aspies - though I have reciprocity over-installed myself. Theory of Mind can be odd. It is usually simply overlooked by those with Autism Spectrum Disorder, especially with full autism. It never occurs to them that they were supposed to be trying to figure out what the other person in the equation might be thinking. But with someone like me, who has a rather finicky rule that we should always be considering such things, does not necessarily actually do it well when the time comes. But friends, favorite co-workers, even girlfriends, I now recognise in retrospect show a ridiculous incidence of High-Functioning Autism.
And I worked with schizophrenics, who are supposedly the reverse in some ways.
If, as Badcock and Crespi claim, schizophrenia is the reverse of autism, it might involve being too imprecise - too willing to declare the identity of unlike data - too quick to pattern-match. If autistics are too quick to mistake signal for noise, schizophrenics are quick to mistake noise for signal. In a well-functioning brain, this makes them creative and socially adept; in a poorly-functioning brain that is constantly getting things wrong, they connect everything to everything else and it's a mess.
The Wikipedia article covers the controversy between whether we should consider Asperger's a disability or mere neurodiversity. I lean toward the disability characterisation. The Elon Musks of the world are few. In the West, especially America, we have gradually created a culture in which over-systemetising (to use Simon Baron-Cohen's framing) is an advantage in a few situations, because it provides benefit to all of us in this highly interdependent economy. We provide places, even high-status places for those who can exploit that advantage via that difference. However, many of them still suffer, and those around them suffer as well. In the main, those who have these conditions suffer greatly.
My current worry is the idea that beginning in the sixth decade, these symptoms may worsen in a significant minority Aspies. I don't think there is much research on it, but I was in discussions with clinicians about this before I retired. They were picking up that things were worsening. It may only be that the support systems were worsening as parents, then spouses, siblings and friends died, and retirement and reduced mobility made others less accessible. If you are an Aspie you might find it harder to replace them, as you may not be bringing the advantages to the worktable that you used to, and your verbal idiosyncrasies may be less charming as you get ever-farther from the dominant culture. You were a refreshing eccentric and your offbeat phrasings were considered witty when you were young and pretty - now you are more likely weird or even annoying. It worries me, both for myself and for my friends. Will it be harder for males or females?
We have never watched a generation of Aspies age before, because we weren't keeping track of them according to that category. It is also going to be hard to decide what to measure. Most likely, some things worsen, others stay the same, and the environment will require extra navigation.