The number of studies done on this subject might tend to suggest there is some connection with PPI’s and impairment of cognition, but as yet nothing that definitively proves it. All drugs carry some risk of side effects, so you have to weigh up the risks versus the benefits as best you can.
I did see one Swedish study that said these drugs are safe but should be used with care for the cognitively impaired - lowest effective dose and only as necessary. But as always with these things they say more research is needed.
Millions of people around the world use acid suppressants called proton pump inhibitors for conditions like heartburn, gastritis and stomach ulcers. Researchers at Karolinska Institutet in Sweden now report that how the long-term use of these drugs could increase the risk of developing dementia...
www.sciencedaily.com
I did notice that one of the American studies mentioned that people can stay on medications for much longer than necessary, which I think is a fair point. Repeat prescriptions with little or no monitoring of symptoms is certainly common in my own experience.
edit: for clarification added the words “these drugs are safe”.