A few comments below taught me that it apparently originates from this meme where it was a mix of a typo and a loving description of a suicidal person.
iirc it comes from a someone posting about thier son who killed themselves and made a typo saying "he was an hero" so naturally 4chan turned the phrase "an hero" into a way to say "to commit suicide".
It isn't exactly celebrating suicide, it's kinda making fun of it in a way.
It started from some myspace post long long ago, in which some kid named Mitchell had killed himself and one of their friends or family members made a memorial myspace page about it including the typo "He was such an hero, to take it all away." The post continues to use "an hero" multiple times, (h/o I bet I can find it, brb.)
/b/tards latched onto it pretty quick, and the meme became that people who killed themselves are "an hero" just like Mitchell.