I see it this way (speaking as a Catholic):
God is infinitely just and infinitely merciful. He (of all) knows each person absolutely intimately and perfectly. He would ‘know’ that His child (call him “Robert”) is a slow thinker, who finds it difficult to grasp concepts, who is easily swayed, etc.
We do believe that God will give us ‘sufficient grace’ by which we are saved. Now, that grace might have to be ‘stronger’ or more ‘constant’ for Robert than it might be for one of us. . .but whatever, it will be sufficient. Robert will not be ‘condemned’ unknowingly; neither will he be absolutely ‘coerced’ by another into error, with never a chance to know ‘the truth’. We don’t know how or when, but there will be a point for Robert, before his death, in which Robert, no matter how ‘slow’ his thought may be, will understand God’s truth and either accept it or reject it. Once he has done this initially, he will either continue to accept or he may at any point reject it, repent and accept, reject, etc. The point of this is, of course, that at some point he will have had the ‘sufficient knowledge for salvation’ which he can freely accept or reject at any time, for any period of time, until death. He may only come to this ‘knowledge’ at the point of death and make that choice–accept or reject–just the one time–but he will not make the choice blindly.
I would not worry about a person being ‘too stupid for heaven’. . .God as I said not only wills that all be saved (meaning, we will all get a ‘chance’ to accept–or reject–His will), He is both just and merciful. His creations may not look ‘perfect’ to us–the man born ‘retarded’, the woman born with deformities of body, etc.–but the souls He creates are equal in dignity and will be given equality of opportunity when it comes to the choice of salvation.