Latching on to this comment, I got "okay" grades, they were "fine", and "I passed I guess" in my mid twenties with a college degree.
However, by that time I realized I had a knack for writing code, a knack that pretty much everyone I've gone to school with in the decade preceding it did not have. They struggled to 'get into' programming, to get into that flow of writing code, to know what to look for.
I consider that my talent. It's been a good ten years now, and I'm still mediocre I think - but that's because I sorta know what I don't know, what I'm not good at.
I'd suck at the currently 'hip' technologies - AI, data science, blockchain - but that's all right because a lot of those are just buzzwords people put in job adverts to try and attract people.
I suck at those too, because I'm simply not interested in them. Don't pursue a career in something you're not actively interested in. It has to click, it has to make sense. And a lot of leetcode or data science just does not click or make sense.
I can manage fine with an SQL database, that's about it.
Anyway, moral of the story is, mediocrity is fine, you're still ahead of most.
Also also, disregard Mensa and IQ tests. Mensa is a company that wants to make people feel smart and better than others so they can flow subscriptions, books with fancy names and shitty dick shaking products their way.
IQ tests only measure how good you are at IQ tests, I'm sure you can practice them. In the end, they mean nothing; if anything it's a weird dick shaking contest where people take one IQ test, get a high score, and live off that high for the rest of their life. They usually get jaded though because a high score on an IQ test doesn't mean shit. It's like being called 'gifted' as a child, it paints you - and your self-image - for the rest of your life, and it can make you jaded when it turns out it's not actually worth much.
Anyway, that's not a problem I had, I was called average once (at a school doctor, in relation to height and weight) and that was just fine by me.