I picked up one of these ugreen displayport KVMs a couple months ago and so far have been happy with it:
https://www.amazon.com/UGREEN-Displayport-Support-Monitor-Keyboard/dp/B0CFFFHFJT
The only issue I have had is that if I’m switched to computer B and computer A goes to sleep, I cannot wake it up through the switch. This was not a deal breaker for me because I have easy access to the power button of both computers. I wonder if this issue may be resolved by powering the switch with a USB-C power plug, since it otherwise requires USB power from both computer connections.
I don’t believe that the USB-C ports can take video input, so you would most likely need to use either and HDMI to DP or USB-C to DP adapter.