Most “keyloggers” are in fact general spyware that detect many things other than key presses and are not at all fazed by on-screen keyboards. But such a keylogger would be software running in the operating system. It's possible to store malware in the computer's firmware, but that's a rather advanced threat; while malware in the firmware of many peripherals can access the RAM, figuring out what the software is doing from outside the OS is difficult. This being said, once someone has written the software, anyone can run it, so it's easy to spread software attacks.
So relying on an on-screen keyboard does reduce the risk of a keylogger attack when running an OS you control on hardware that you don't fully trust. It doesn't eliminate it, however. Using hardware that you don't trust also has the problem that you can't know that it's really executing your program. It would certainly be possible to write spyware that analyzes the OS on your drive a bit and invisibly injects itself into it.
If you really don't trust the hardware, don't use it, period.
If you kind-of trust the hardware, then you can reduce but not eliminate the risk by reducing the hardware attack surface. Eliminating the keyboard is an advantage in at least one situation: in a cybercafé-type environment, when you trust the administrator of the machines but you fear that someone will perform a discreet modification such as inserting a hardware keylogger into the keyboard. Still, once the software for the attack has been packaged, it's easy to insert a piece of hardware that's actually a USB hub with the attacker's hypervisor, causing your OS to run inside the attacker's hypervisor and thus exposed to the attacker's spyware. You're just requiring the attacker to be a bit more sophisticated.
Once again, the only way to have confidence in a computer is to trust its hardware. If you don't trust the hardware, you can't trust any software that runs on it.