I know these days it's super un PC to say things like 'badwrong fun" and it's a cardinal sin to even hint that someone is playing the game the wrong way and whatnot, but if you have a role-playing game where you treat role-playing with such contempt? I think you're missing the point.
"If someone wants to roleplay over optimization? I'll teach 'em and they won't ever do that again."
Thank GOD I have never had anyone like you at my gaming table over the past 30+ years. We would not get along at all. I don't view the game as some sort of optimization competition between the DM and players, and especially not between players themselves.
The thing is I have no contempt to roleplaying, I love roleplaying or I wouldn't do it. I just happen to understand you can optimize, min/max, and power game all while roleplaying. In fact most of the optimization happens away from the table during character creation and level up.
See having your elf use a rapier over a longsword doesn't affect real roleplaying, just change your background to match the optimal build choices. The real roleplaying is the character interactions, the story, choices made, paths taken and not taken, npc's loved and lost. All of that doesn't really change if you use a rapier over a longsword, what does change is the game math that helps keep you and your allies up and if you come out on top.
In my games I just let people refluff most things, so the character has the stats written down for a rapier and in game it functions just like one, but I don't care what it looks like, it could made of crystal look like a fine elven longsword, be a big pointy stick for all I care. No character in my 5e games PC's or NPC's use leather armor, they all use the stats for studded leather it can be hard rigid leather plates, rare elf leaf armor, salamander skin, again don't care. The mechanics and math all work out the optimal way and the characters can refluff for "roleplay" backstory cool factor reasons all they want.