Mental competency tests are too subjective and could be abused, if they were reliable I would say yes
However, I do think there should be age limits on certain offices. Generally, I think candidates older than 70 are out of touch with the desires of the general public/voters and are loosing mental competence.