Dear Seraphina,
Wa alaikum assalam
From a Quran's perspective, the rules of permissibility and unlawfulness in these circumstances arguably do not apply in exceptional circumstances.
This overarching principle / sentiment is made clear by verse 5:3 which states in the context of food that:
"...Anyone who is compelled by hunger, not by will to eat what is forbidden, not intending to commit sin, will find God Merciful and Forgiving".
For example, from a Quran’s perspective, human life is sacred. Humans are not to take the life of another human being without just cause (capital punishment for murder or for spreading corruption in the land - 5:32, 4:29, 4:92-93 and 6:151). Therefore, killing another human being for food remains prohibited. One could argue then that it is permissible to consume human flesh after death has occurred naturally. However this is also negated by verse 5:3 in which carrion (dead meat) is also prohibited.
However, there is an exception that can be argued in accentuating circumstances where even dead meat can be eaten but such a situation would be extremely rare. However, there have been cases where stranded people have kept themselves alive long enough (only eating as much as they need) from the dead bodies of other humans. Again the maxim "...Anyone who is compelled by hunger, not by will to eat what is forbidden, not intending to commit sin, will find God Merciful and Forgiving". would remain applicable.
No doubt this is an extreme situation.
You kindly share:
But think about it - if you would be in a difficult state, and a doctor would tell you that a daily dosage of alcohol is your cure, would you accept it, even if it is not through your mouth but through your veins?
If there is no other option left to sustain life, then arguably from a Quran's perspective, laws governing unlawfulness in normal circumstances are relaxed to cater for mitigating / exceptional circumstances.
For example, up till approximately the 1980s, animal insulin (often derived from cows and pigs) was the only real treatment for diabetics’ wholly dependent on insulin. Obviously, if verse 5:3 is kept in mind, the only reason such medication could be consumed would be to protect life and not to consume it with a view to transgress.
I trust that you will find noteworthy that I have shared with you an explicit exception directly from the Quran (5:3).
I hope that helps, God willing.
Your brother in faith,
Joseph