Hamlet is the only one who says this this way.
The only one who comes close to this as he is dying is Bottom in the role of Pyramus. (“Now am I dead. Now am I fled.”)
It has a flavor of Polonius’ last words, (“O, I am slain.”)
But it is curious that Hamlet declares himself dead before speaking several long passages of text. He repeats it, too, with a slight variation – again before continuing to speak for a bit.
I’d like to understand why Hamlet declares himself dead. Polonius is more accurate. Even though he is not yet dead when he says I am slain, he is right that the action is the end of him. And Hamlet is right that he WILL be dead. He just isn’t yet and he says it twice. He could just as easily say he is dying and yet he chooses to declare himself dead.
Is he settling into an idea? As someone who has wondered what it might be like to be dead, is he self-monitoring, trying to document deadness? What he is actually doing is dying – which is an entirely different state of being. Is he trying to prepare himself for the future by declaring himself already there? Is he trying it on? It doesn’t seem accidental that the most self-reflective character in the canon would be the only one to speak about his end this way.