You are wise to try to protect your password, but modern malware can attack you in many other ways (monitoring the network traffic, real-time session hijacking, etc.), so you really just shouldn't expect anything you do on a public machine to be secure. See the answers at the IT Security Stackexchange for more information:
One good strategy noted there is to use really low security accounts for high-threat activities. E.g. if all you want is to be able to read an occasional email, e.g. to print an airline boarding pass from a computer at your hotel, you could set up a separate email account only used for such things, and forward the emails you want to print using your smart phone.
Back to your specific question: in 2012, Google was experimenting with a way to log in to a desktop computer, using your smart phone, scanning a QR code displayed on the desktop: Open Sesame: Google’s Newest Security Log-In Uses QR Codes | WebProNews. Sounds like a good option for some situations, but they cancelled the service before going public with it.
The Google option to use OTP for the 2nd authentication step, in the answer by John C, is handy if you can't get SMS messages while travelling, but you still expose your main password to keyloggers. His idea of mixing it up via notepad may help, but won't protect against a determined attacker.
I still wish there was a way to avoid having to enter your main password on a public kiosk.