The thing is.
If D&D is a game, then there must be a win state.
Many D&D fans do not like the concept that you can win at D&D.
You can't say you hate builds and optimization if D&D is a game.
Having fun might be a goal of the players, but it's not typically a direct goal of the game. Rather, the goals are dictated by the rules, which should (ideally) result in fun.
In other words, the win state in Super Mario Bros isn't to have fun. It's to get to the next stage (which ultimately culminates in beating the game). Achieving these win states results in what we refer to as "having fun".
So this discussion relates to something very fundamental about RPGs that is different than most traditional games. Playing an RPG is like when an adult plays around with a small child, such as when they wrestle or chase each other. When you do so you can easily "win" versus the little kid, so if the kid "wins" it's because you purposely let them win. So the game isn't really about trying to see who wins, its about you pretending like you are trying to win but really holding back so the child feels like they have a chance of winning while still being challenged.
RPGs are like this. No matter how skilled the players are or how powerful their PCs are within the fiction, the DM can easily win because he or she has essentially infinite power. That's why you get the infamous "rocks fall, you die". So if the players win it's because the DM let them win. It's not like in blackjack where the players have a legitimate chance of winning without the dealer purposely going easy on them.
Some will surely say that they create scenarios without the PCs in mind and leave it up the players to figure out how to deal with them. But you aren't really creating the scenario in a vacuum. You know what PCs in the game you are playing (whether that's D&D or something else) are capable of at least in a general sense and create with that in mind. So you present obstacles that will provide enough challenge to be interesting but not so much it's frustrating or impossible. Take the Tomb of Horrors. That's an absolute meatgrinder that is far more difficult than a typical scenario a DM would use. Yet it was still designed for it to be possible for PCs to survive. Gygax could have easily created a module that was truly impossible for a D&D character to survive but he didn't.
So tying this into skilled play and how Snarf Zagyg has said that it depends even more heavily on the quality of the DM than other play styles. Creating an RPG scenario is like doing an Easter egg hunt. Just as when playing around with a small child, with an Easter egg hunt you want the kids to "win" so you create an appropriate challenge for them. When the kids are 2- and 3-years old you put the eggs out in the open and low to the ground so they can easily see and reach them. As they grow up you put more effort into hiding them and place them higher up, but still make them easy to get.
To maximize fun for the players, as the DM you try to create scenarios that hit the sweet spot for difficulty. You want the loot and traps to be hidden well enough that the plays have to look for them, but not so hidden that they never find any loot and are always caught in the traps. With play styles that emphasize PC mechanical abilities, this is easier because you're dealing with concrete mechanics. For instance, "hiding" loot and traps is really about setting a DC that it will determine if a skill check will succeed. So you have an objective measure of how well hidden it is relative to the PCs.
With skilled play, finding that sweet spot is a harder because you have to really understand the players' metagame abilities and approaches and cater to that. And as they get more skilled (and get to know your tendencies), you need to adjust in order to increase the challenge accordingly without making the players feel like you are using cheap gotchas.
So the Super Mario Bros analogy is both similar and very different to D&D. It's similar in that video game designers can make the game as easy or hard as they want, but try to hit that sweet spot. It's very different because the players of Super Mario Bros don't have to deal with the designers adjusting the game as the players become more skilled. If someone plays for a hundred hours and memorizes everything, the game doesn't change so that the player needs to alter their approach.