I'm not an advocate of ultra-optimized munchkins for characters. But my reasons for not being a fan of that playstyle have nothing to do with "realism" or any attempt to mimick the real world.
Yeah, but Morrus, you didn't ask us why *you* do it. You asked it as a general question - why would anyone do this? Some, because they feel that mechanical optimization is not consistent with the semi-believable personality they're trying to get the character to have. It is an answer to the question. I didn't claim it was your answer.
This goes doubly when we consider that optimization isn't a one-time thing, but it requires maintenance as the character grows in power - to stay optimal, you must stick to the optimal build. But, game events may make the choice to stay on that optimal path unreasonable, from an in-character point of view.
As an example: say you're on your optimal path, and it includes several levels of a prestige class, and your GM is holding to the original presentation of Prestige classes, that you have to role-play through acquiring them. And, you just found out that the organization you'd have to join to get that prestige class is... evil to the core. And you're playing a Good character. Maybe staying optimal is now not a thing the character would do....
Roleplaying isn't to approach the game like real people, it's to approach the game as a role.
I don't believe you get to declare for the entire planet what roleplaying is or isn't. Sorry.
And, in any case, "real person" is a role one can choose to approach the game. Though actually, here I'm more interested in
believable person - there's a difference, akin to the difference between "realism" and "verisimilitude" if you want to get into semantics. Let' us not go down the whole "realism in RPGs" strawman argument, please.
You pretend to act like the character would do, not like real people do. Real people run scared when a dragon appears.
The stunningly complete lack of actual dragons makes that pretty hard to assert.
However, our history is filled with verifiable cases of people facing threat of bodily harm with bravery. Soldiers holding up against impossible odds, firemen running into burning buildings, and all that. Bravery under threat is believable, as it does happen in our world.