My keyboard and mouse can pair to multiple different machines at the same time and switch with a button press so I just do that.
Synergy also works fine, you just need to temporarily pass a real keyboard in to set it up.
There is also a newish feature in QEMU that allows they physical devices to be swapped back and forward by pressing both CTRL keys [1]. It works reasonably well with a few quirks (Extra mouse buttons dont work in guest, for example)
Same thing apples to the screen, I surrender an entire monitor to whatever VM is running, but you could use a KVM switch.
It's a little work to get set up and tuned but it is 100% a dual boot killer. The next time I reconfigure this machine, I won't be installing a native Windows partition, I simply don't need it anymore.
Heres a video demoing and explaining it a bit: https://youtu.be/16dbAUrtMX4
[1] https://www.kraxel.org/blog/2016/04/linux-evdev-input-suppor...