Lose all your stuff and start out at the beginning.
Azure Dreams is a roguelike for the PS1. You have a town where you can do dating sim and a bit of building sim stuff, along with minigames and shops. The actual roguelike stuff happens in the monster tower just outside town. Whenever you enter this tower you start out at level 1 with the exact same starting stats. You can only bring 5 items into the tower with you. You can also bring two familiars (basically pokemon) with you, who can fight alongside you or augment your attacks with their magic. These familiars gain levels just like you, but they keep their levels and stats when they reenter the tower.
If you die in the tower you end up outside it with only the familiars that went in with you. Everything else is gone.
It's possible to leave the tower at any time with one of several different items. If you leave this way, you keep all your stuff.
While you probably should keep permadeath, there's no reason you can't have a few second chance items or abilities around. These could punish the player by having the player awaken closer to the beginning of the dungeon, with less gold or missing a few random items, or several class/character levels lower (alternately, give the player negative experience, which must be worked off before you can gain a new level).
I don't think that the player should have unlimited retries, though that could be an option the player could select. Instead I think that the retry feature should be linked to another game mechanic. If your game has pets or familiars, then the familiar could have several chances to teleport you away, but at great cost to it and yourself. There could be a cap on negative experience which will cause permadeath if it moves past that cap (if you die too many times).
What mechanic you choose depends on how your game works, and on how the roguelike stuff is done. If it's in a repeatable, randomized dungeon (like in Azure Dreams), then you could punish the player as harshly as that game does, because the player can still start again with his familiars and the items he keeps in his safe at home. If the whole game is a roguelike, then you need to do something a bit more subtle especially if you intend to keep permadeath.
Negative experience is probably the most devious thing you can do, because it temporarily locks down character/class progression and forces the player to be cautious for a while until he or she can start gaining levels again. Losing gold is always good, especially if shops and consumable items are available (even more so if they are necessary or very useful). Losing random items can be horrifying, so each item should have a value rating or there should be a way to derive a value rating. This matters because powerful characters with lots of time invested in them should pay more for a second chance, while less powerful and time-invested character should be fairly cheap to save from permadeath. This in itself is a mechanic that makes the game difficultly increase over time, as you gain more powerful and useful (or one of a kind) items.
One last idea I had just now - dangerous enemies could be produced where you died. If you died on the 5th floor of a tower and your familiar drags you to the 3rd floor, then maybe the shadow of your death should be skulking around the 5th floor, waiting to embrace you. So if you want to get past it, you need to grind a bit to defeat yourself as you were before because you're fighting yourself as you were when you died.