[Person asking the question]
I know that buddhists keep the precept to not take drugs and alcohol, but medication is allowed.
Cancer patients for instance, will usually get morphine at some point, which is not a cure. As a buddhist; should one then refrain from taking them? Have strong pain, but a clear mind? Maybe we even burn off some dark Kamma by experiencing this pain?
I would tend to think that a clear mind is of the utmost importance, but death can be excruciatingly painful, though we might be able to spend at least some amount of time in the arupa jhanas.
The Buddha would go into the fourth jhana and other states, to relieve the painful physical feeling from his back pains. For one who has terrible pain, medication such as morphine is required.
Remember – it is about context, intention, and understanding – one can later become addicted to the morphine, after perhaps going into remission.
But what changed? It was the person’s intention and their addiction, their craving for it, not the morphine itself.
Alcohol on the other hand would generally cause dullness and thus create a mind that is prone towards being heedless. Alcohol is/was sometimes used as a base for certain medicines, so it was okay to have it, to treat pain and symptoms. However, the intention here is not to abuse it and crave it. It is to cure an ailment, or to relieve symptoms.
Of course, a clear mind is always the best option at the point of death, but given that pain can cause Formations to arise at death, which can be unwholesome, there is the chance mind may hold onto them, resulting in the new consciousness emerging into a painful existence in the next life. This is of course an over-generalization, but meant to illustrate a point.
The point here is that a comfortable death – whether through a mind having been cleared through jhana or through letting go, or through a mind that requires medical assistance for that comfort – is more preferable than a painful death.
As regards to experiencing that pain – yes, it is possible that this is karmic in nature too.