Zero caffeine for the last 3.5 years.
PPIs can definitely affect magnesium. https://www.gov.uk/drug-safety-update/proton-pump-inhibitors...
On the other hand if your heartburn causes reflux then the PPI can help sleep. https://www.ncbi.nlm.nih.gov/pubmed/24942514
Kind of taboo, since most like to think there's no side effects, but many find it can mess with REM cycles and, consequently, nightly dreaming[1]. REM, being where you get your most restful sleeping done.
Although stopping cold turkey is likely to not help much initially.
[1] https://www.vice.com/en_us/article/7b7gn4/why-are-your-dream...
(Anecdata) Which is a terrible drug for me, creating absurd and artificial peaks and droughts of energy, completely throwing me off. The worst part is during the low sections I have some craving that keeps me on my toes, like some raw hunt/forage impetus, making me even more tired. Overall low carb diet and skipping on sweet things entirely fixes it for me.