It's not simple. And "just don't do it" is not good game design.
It absolutely is good game design particularly in an rpg. If I want to run the entirety of act 1 solo (no npc’s) as a cleric, I’m gonna be hittin the hell outta camp. It’s my game, my prerogative.
If you want to run a full party of 4 and never rest, so be it.
Pretty soon someone is going to tell me not to put tobasco on my steak because it’s not meant to be ate that way.
...that's not how game design works. Every game is bound by rules, rules that (hopefully) make the game fun, but also rules that present challenge.
To create an over the top example, Larian could allow players to have unlimited actions per round. That would allow you to attack as many times as you wanted, and others to attack however many times they wanted. Would this be good game design? Obviously not, because it trivializes combat and would make the game boring. For your example: there are more ways of designing the game so that you can solo it, ways that don't actively harm others' experiences. In fact, simply having infinite rests is probably one of the worst ways. Resting 5 times in a row won't help with individual difficult combats. For example, experience could be gained individually, so a 1-person party would level up faster.
Similarly, the rest mechanic trivializes resource management. There is almost no reason to use food or short rests, the classes are not balanced with each other, and much of the risk-reward system is gone (e.g., saving a more powerful spell for a future more difficult encounter but risking damage/defeat in this combat).