If you're actually concerned about keyloggers and unsafe sudo, use 2 factor auth. You can set it up with hardware keys or something like duo.
Not that getting root is too interesting for malware running on your personal machines that runs all the interesting code as uid1000. https://xkcd.com/1200/