There are some extremely powerful narcotics and powerful painkillers that can be grown legally in your garden. Some significantly outperform anything you can buy in the shops. However with over the counter medicine you obviously have the marvellous bonus that taken in correct dosage, they won't kill you. So I'm not going to suggest you go down that route. In terms of just killing pain, medically regulated drugs really are your safest bet.
However there is one herb that can be used safely for headaches and migraine without concern of overdose from moderate ingestion. Wood Betony (Woundwort) can be taken in tea or capsule form and can be bought in some health food shops, often in conjunction with other herbs. You can grow Betony legally and safely in your own garden. It will grow in full sun or partial shade so it will hopefully thrive in whatever conditions you have to grow it in.
There's a good article here that will give you more information and some detail on dosage.
Disclaimer - Not only am I not a doctor and not medically qualified at all, I don't even identify as a green/herbal witch. So obviously take my information as a starting point and discuss with your own doctor before taking a herbal remedy that anybody recommends over the internet.
Join the Witch Path Forward Facebook community. (Click the icon).
Changing your path/religion/way of life can be a time in your life when you need a bit of support. The purpose of this site is to offer a helping hand and a starting point to explore all the information available on the net.