Lock the PC? Unless they can control alt delete should be good. Unless they want to smack on it while YouTube is going or something. In that case I would put a spare kb/m (unplugged) there for them to play with.
many keyboards have a lock key (if you want to keep the light on and it is the reason you do not simply unplug it).
In windows (if it is a recent one 10-11) you could launch a sandbox, make it fullscreen and have him type what he want in notepad... alt-tab should not make it quit it, but alt-f4 and good key combo maybe could...
This message is not an endorsement to exposing toddler to screens