It's interesting that even in the Roman Republic the immunity ended after the end of your term, and you could be prosecuted for official acts taken during it. And even let to Caesar fighting to keep himself in office at all times to avoid inevitable prosecution. https://theconversation.com/from-caesar-to-trump-immunity-is...