Or a Rogue that ignores many key class features, but that was pretty unoptimized.
Yes. The issue was never so much that you couldn't build a seemingly incompetent or non-combatant character, as that doing so would require intentionally 'gimping' it with very bad choices, or flat-out ignoring abilities it got from class & level (also meaning there was always a temptation to break character), and radically under-contributing to the group.
In 5e you could still do those things and count on the DM to tailor challenges so your lack of contribution doesn't hold the party back, and even tailor specific challenges that only you can get the party through, thus giving you your share of spotlight time and maintaining 5e's style of balance. (Which is, let's face it, exactly what's happening via 'author force' in fictional examples.)
The DM also always has the option of dropping a potent magic item on an under-performing character to bring him up to snuff.
I think the only edition of DnD where you could get away with that would be 4e with a Warlord.
Nod. 4e was more into 'player entitlement,' so if you wanted to play a character that didn't /seem/ to do much, you had options to do so - and still contribute without seeming to as directly. It didn't even seem like it was a design intent, just something players figured out was possible with certain build choices.
I suppose I could argue that in both cases D&D wasn't doing much to enable the character concept, it had just provided tools that the DM or Player could use to do so, if they saw a way and made the effort.
But plenty of d20 games that were otherwise very much like DnD made it work. The D20 modern game had the cha, int, and wisdom based heroes. Star Wars d20and saga edition had the Noble. Conan d20 had a Noble
Yeah, I finally took a look at that one, it was interesting.
and a Temptress class. Fantasycraft has an Explorer, Sage, Keeper, and more. Some contribute more in a fight than others, but all do a good job of letting you play a character less focused on stabbing stuff in a fight.
My list of stuff I should check out some time is growing.
If you need crunch to encourage you to play to your Traits, Ideals, Bonds, and Flaws, you're missing the point of Traits, Ideals, Bonds, and Flaws.
There /is/ such crunch: Inspiration. Play up what you wrote down in those spots on your character sheet, earn a treat.
(As you can probably guess, I'm not crazy about such mechanics, but it's definitely there, and is part of that sub-system, so could be said to be a point of it.)
Optimization is invariably focused solely on in-combat mechanics. As though a CHA-focused intrigue character can't possibly be of any use.
One of the most notorious 3e optimization exploits was the Diplomancer build, able to turn hostile or suspicious strangers into helpful new best friends with a single roll of the d20.
I had a table like that once. They gave one player endless grief because he wanted to play well-rounded characters, not just damage-dealing murderhobos. He was about to quit the game over it. That made me think about my approach as DM, as well as their behavior and focus. Turns out I was rewarding that by making the game an endless stream of wilderness and dungeon combat experiences. So I threw them into a major settlement where the excellent killers were certainly not optimized; in fact, they were virtually useless.
(Depending on the edition, that might not have been all their fault. It's not like 1e, for instance, let you decide to invest your fighter's skill ranks in non-combat skills.)
They burned that city down and went back into the wilderness.
Congrats for leaving them some 'player agency.'

I've heard more than a few stories of Village of Hommlet going that way, the first time I ran it, it almost did, but for one player who kept pushing to go investigate the Moathouse (thanks John, you're a prince).