I have a rather janky setup that doesnt use a KVM. My concern was that pc gaming was hindered unless I spent crazy money on a KVM that didnt mind the high refresh rate and resolution of the gaming monitor.
so Im detailing this out just to help you understand some ways that this can be achieved without a KVM.
I have my work laptop hooked up to 2, 27" 1440p monitors via a dock. the dock goes to each monitor via DP or HDMI
My PC connects to the same monitors directly via DP or mini DP - basically which of the better ports is available on that monitor, with the other used by the laptop dock.
So switching between monitors is via the onboard controls of each monitor, which in my case is just a button on the bottom right of each....I dont mind doing this as I dont switch back and forth often, I normally do it once the working day is over.
the keyboard and mouse is a logitech m590 and k580, these are bluetooth and can switch rapidly between the laptop and PC by a single button press. I understand there are newer paired versions of these which improve on their capability.
My headset is a bose qc35 which can work easily with multiple bluetooth connections, though I ended up using a wired headset plugged into the laptop dock
My speakers are only plugged into the gaming pc and harly ever get used, the laptop has the option of using onboard speakers from itself or one of the monitors.
....
however I realised that while I prefer typing on this keyboard, I prefer the mechanical keyboard and wired mouse for gaming, so they are plugged in at all times and I just shift the bluetooth stuff out of the way if I want to play games.