That's simply not how the world works, though. You don't get better at casting fireball by casting fireball. You get better at casting fireball by hitting things with your staff (or casting cantrips, I guess), because you've run out of fireball for the day.
If you think that feels artificial, then I don't know what to say. D&D has always been kind of weird about that. If it helps, you can think of not casting spells in the same way as a fighter choosing to fight with their off-hand, because it increases the challenge.
Back when I gave out XP, it was for overcoming obstacles and achieving goals. How the players did it, what pace they decide to do things was completely up to them. If they decided to take a long rest, the world and other events continued to happen without them but I never punished them for it. Of course if they took a long rest reinforcements might be called, the BBEG might escape, etc.
But how much they learn? Why does it matter if they cram or spread the learning out over a few days?
And you're right that not every adventurer is going to worry about optimizing their learn-rate, of course. But why, then, should the game force advancement on you? Why should your character, who doesn't care about becoming the best, advance at the same rate as their companion who does care? That seems more artificial than anything else, especially if your answer is from a meta-game perspective.
I'm not a huge fan of Fire Emblem, but in the one I played (ten or fifteen years ago), this is addressed from an in-character perspective. Basically, the main character starts out at as a chump, but you also have a champion who is much more powerful to help you out. One of the other characters makes a point of saying that yes, you could just send the champion out to do everything alone, but it's not fair to deny the less-experienced hero their chance at proving themself - and it may even come back to haunt you, later on, if the champion is no longer around to protect you.
That's really all there is to it. The kinds of people who take the easy way out, and never challenge themselves, are not the kind of people who end up as mighty heroes. It does seem to imply that D&D really only works for certain types of characters, but then again, there are no rules saying that you must gain levels.
Which is another way of saying: your character has to play this way with this motivation and this goal. No thanks.
Anyway the answer is still: I think this is a lazy solution that relies on meta-game mechanics and I think there are better ways of challenging characters (whether you have 3 encounters or 9). You don't.