Standing on an altar while having zero items in the inventory and using the 'O' command to offer a sacrifice yields a special message: "Do you want to sacrifice yourself?" Replying 'Y'es causes the PC to strangle him- or herself on the altar until he or she dies and is received by a triumphant deity.
Players who wear an amulet of life saving are not safe from this form of death; the deity will get angry at the attempted deceit, destroy the amulet and still take the player's life. Lawful deities will instead become "very displeased" by this action while letting the PC live "leaving the amulet (...) intact".
There is no reason for the player to do this whatsoever beyond it being a hilarious and original thing to do if the player is fed up with the character in question. Well, it's original only once, and hilarious rarely for more often than once, but you get the point.