I got a C in a core class. Should I retake it?
An easy answer, from the viewpoint of grad admissions, at least: iffy grades are a blot... but/and, also, a serious question is about the extent to which "bad grades" reflect you understanding ... of things that need to be understood, not just gatekeeper stuff.

Also, you'll be competing against people who have reasonably-good grades... for whatever that's worth... but/and grad admissions committees will not see much up-side to admitting people who "show" worse than others.

Also, btw, it's not so hard to get good grades in undergrad stuff, even if one isn't ultra-conformist. True, it's also not hard to get iffy grades even when one has a pretty good understanding. But/and (!) in these days when everyone on the planet hopes to make a living as a computer-scientist (for example), not being prey to the standard tropes/weaknesses may be the selling point.

That is, maybe retaking courses to generate better grades that will mask old, not-so-good grades, is worth your time... unless, on a different course, you can do "genius-stuff" ... which makes schooling irrelevant, ... maybe.