Given that we strew the dungeons of our campaigns will piles of corpses, it's unsurprising that we treat death so cavalierly. I mean, check out this passage:
DM: "Black Dougal, you find out that you missed a tiny discolored needle in the latch. Roll saving throw vs. Poison, please!"
Dougal (rolling): "Missed it!"
DM: "Black Dougal gasps 'Poison!' and falls to the floor. He looks dead."
Fredrik: "I'm grabbing his pack to carry treasure in."
That's from page B59 of Tom Moldvay's 1981 Basic rules. Stone cold. They don't even check to see if he is actually dead before they start vulturing his stuff. This is the rpg I started with, this is how I was taught dying worked in D&D. No wonder I've got the blood of so many PCs on my dice-throwing hands.
"From hell's heart I stab at thee; for hate's sake I spit my last breath at thee."
But for general purpose death scenes I'd recommend keeping this formulation in your back pocket:
"I've seen things you people wouldn't believe. Attack ships on fire off the shoulder of Orion. I watched c-beams glitter in the dark near the Tannhäuser Gate. All those moments will be lost in time, like tears in rain. Time to die."
Obviously you'd want to swap out some awesome things your PC has seen. This one works best in a FLAILSNAILS environment where you're probably adventuring with people who haven't seen the same exact horrors you have, which is why I have a version of it saved on my PC's charsheet, ready to go.
Of course, you can come up with your own final words, or steal them from some other source. The important part is that we should put a little forethought into this, especially for beloved characters. And DMs, give those players a chance to say something before they shuffle off this mortal coil. You know, unless their death is particularly quick and/or grisly. A smoldering skeleton probably won't have much to save.
These last words are appropriate under any circumstances.