I know that out of desperation Moshe asks God to kill him and I don't necessarily see any reason it would be forbidden but I was curious if there was any discussion, halachic or otherwise, as to whether or not someone may request that God kill him.
This definitely isn't a halakhic answer, but there is a remarkable story about the Klausenberger Rebbe: when he was in Auschwitz and Muldorf he prayed for death, and then after the war he did teshuvah.
Variants of this story appear on the Yad Vashem website and in the biography "Lapid ha-Aish", written by Aharon Surasky and translated into English by Judah Lifschitz as "The Klausenberger Rebbe".
you have free will to ask whatever you want. the real question is it appropriate to ask God to kill you under certain circumstances.
the talmud says everything that God does is for the good.
according to this, if you are still alive even if in great pain then it is for the good.
if so, then it is not appropriate to ask for death.
when a person is going through difficult times his duty is to try to accept it with a good heart, as the duties of the heart gate 8 ch.3 writes: "Know, my brother, that for the ten trials which G-d tested Avraham our forefather with, we would not be praising Avraham for standing up to these trials, if it were not the case that he had received everything from G-d willingly and with a good heart, as written: "And found his heart faithful before You" (Nechamia 9:8). As for the generation who left Egypt, they were deserving of condemnation and rebuke in the desert only because they became angry and their hearts were not good with G-d and His prophet."