"Young man, in mathematics you don't understand things. You just get used to them." —John von Neumann[1]
[1] https://math.stackexchange.com/questions/11267/what-are-some...
Very much this. "I’d prefer to not be mediocre."
OP: You are holding yourself back as long as you believe this. If you enjoy programming and aren't burning out just struggling to pass, just keep at it. You're at first year in uni. You're not expected to "be" anything but learning and getting by.
If you made the brainfuck interpreter for yourself, you shouldn't let others' opinion get to you like this. And if it does, be more conscious about who you solicit opinions from.
If it's course-work, well, it's just part of the journey. It's normal to rewrite your study projects from scratch once or twice or more. Try different ways to do the same thing and keep an open mind.
Finally some motivation: I'm probably twice your age, and no doubt the kind of motivation and curiousity you say you have is worth 10x more in the long run than 10~20 IQ here or there.
Also read this: https://pthorpe92.dev/programming/magic/
If you enjoy something, pursue it. There are some caveats, however. You have to get out of your own way. If you want to believe you can't do it, congratulations you have achieved your goal. If you expect everything to be below the cusp of hardship, sorry but it won't be that way. You have to allow yourself to wallow in your own ignorance and accept it. This, however, has to be WITHIN REASON. Too much of this and you will burn out. Sometimes the program you may be in may be beyond reasonable effort on your part. In this case, you need to find another way of learning that is more tuned to your pace.
In short though, you have incoherent goals. You want to do research yet failing that you want something high-paying. From my perspective it's hard to take you seriously. If you're unserious about this then I can't imagine you being particularly serious about your own development. Let's be reasonable here. You say, for example, "I'm not even looking for [...] people to tell me that I am smart enough [...]." GET. OVER. YOURSELF.
You seem to be lacking confidence. Do you think about OS concepts? Do you use whatever devices you use and say, "Hey, I think this could be better." Do you doodle ideas about how they could work and behave to improve your productivity? Great, you are in the right program. In time, you will learn tools, concepts, and theories to make your ideas real. If you're not curious or wondering about this already then find another major aligned with something you're naturally curious about. That said, sometimes the academic process will beat any love you had for the subject out of you.
If you're competent and have an above average amount of hustle, you can be successful at anything in a stable, modern, Western democracy... for now.