I like the way the game
Prey handled death, and I think it could be adapted to pen-and-paper, after a fashion. In
Prey, the main character, Thomas, has the power to see and move through the spirit world. When he dies, he goes into a dreamy mini-game, in which he must shoot flying spirits with a bow to regain his health and spirit energy. At the end of a short time limit, he is resurrected on the spot with whatever health and spirit energy he could gather. In a PnP game, you could follow a
TPK with a short adventure, in which the dead heroes must fight their way out of the underworld. In D&D, you could balance it out by having the players fight enough encounters to earn a resurrection's worth of treasure.