Countries like Brazil and the Philippines already disqualify candidates under formal indictment for serious offenses specifically to stop the office itself from being used as a shield against prosecution -- waiting for a slow-moving trial to finish while someone governs risks normalizing exactly the impunity the law is meant to prevent.
Feels like banning someone just because they're charged and not even convicted means anyone in power could slap charges on a rival right before an election just to knock them out of the race.