That hypothesis comes up repeatedly, but I imagine it would hinge on whether or not judges would say to themselves, "he's too stupid to jail". IANAL, but I believe judgement is based on whether or not you did "it", whatever "it" might be. Then
at sentencing a judge could use "stupid" as a mitigating factor. For example, "normally you'd get 20 years, but because you're stupid..."
But I can not emphasize enough that IANAL, and this is just (as with most folks, I would guess) something I pulled out of my butt. Based on what little interaction I've had with the U. S. justice system, man, I sure wouldn't let the outcome rest on the judge's view of my intelligence, though.