I use a multipairing mouse and keyboard (Logitech MX Keys and MX Anywhere) and have my personal laptop connect via Thunderbolt → DVI and work via HDMI. It means I have to press three buttons to switch but it's still pretty convenient, without the expense of a dedicated KVM solution.