When you say “avoid jailing political enemies just to take them off the ballot”, do actually mean “avoid prosecuting criminals just to avoid accusations that you are politically motivated”?
In my view, the only reason to jail anybody is because they violated the law. If somebody that violated the law is subsequently jailed, it feels pretty dishonest to say that it was done “just to take them off the ballot”. Not only that, it is inaccurate. Jailing somebody does not take them off the ballot. However, not prosecuting them DOES put them above the law.
Perhaps we have different ideas about the real problems described above.