USB-C KVM
The product you're describing does exist... kind of. However, because it's a niche product, there are only really two implementations I'm aware of—both of which are very expensive and don't really do quite what you want.
US3310 - $200
Though the exact branding and seller varies, there are at least two (1, 2) identical versions of this hub for sale. It features two switchable USB-C connections (with power passthrough), two USB-A in, one HDMI 1.4 out, and a USB-C power port. Notice the HDMI out: while this will work just fine, you'll have to drive your monitor off HDMI—not USB-C. This means that you won't be able to use the USB hub in the monitor without a second adapter to plug it in to the USB plugs on the front. Eugh.
Black Box - $300
Again, we've got two switchable USB-C connections, several USB-A in, and a DisplayPort out. Again, we've got the same issue, where you'd need an adapter to use the hub in the monitor.
Standard KVM + Hub
Another option to keep the single-cable functionality is just to have your laptop connect to a USB-C hub, which then breaks out into a "standard" display interface and USB, then runs into a KVM. Is this discarding one of the key features of your monitor? Yes. Is it cheaper and cleaner than getting a USB-C KVM? Maybe, depends on your idea of cleanliness. But it's almost certainly cheaper. Depending on what specs you end up deciding you want, you can get a hub for about $30 and a KVM for about $40. If you choose to go this route, I can definitely make some more specific suggestions.
Software KVM
Through the power of networking and software, you could get most of the functionality of these hardware solutions with almost none of the hassle. Using something like Synergy, you can share your mouse and keyboard over the network. However, since this would require the laptop to be plugged in, even when you're using the desktop, I'm going to assume this is probably a no-go. Further, other USB devices aren't shared, so if you wanted to (for example) plug in a USB drive, you wouldn't be able to use the hub.
Just buying a different monitor
This is probably going to sound really stupid, and in a certain sense, it is. However, it's also probably the cleanest, nicest way to get what you're looking for. Currently, several monitors offer built-in KVMs and USB-C, with convenient switching between them. Are they all more expensive than the P27H? Yes. But will they also offer a lot of other benefits, including greater resolution, size, or color accuracy (depending on the model)? Yes.
I won't go too in depth into each monitor right now—again, if you decide this is the right path for you, I'll be happy to help more—but here's a quick overview.
Philips 499P9H - $850
48.4", 5120 x 1440 @ 70 Hz, VA
2x HDMI, 1x DP, 2x USB-C, 2x USB-C hub, Ethernet, headphone jack
Philips 346B1C - $440
34", 3440x1440 @ 100 Hz w/ FreeSync, VA
1x DP, 1x HDMI, 1x USB-C, 1x USB-B, 4x USB-A hub
Samsung CJ890 - $770
43.4", 3840 x 1200 @ 120 Hz, VA
1x HDMI, 1x DP, 2x USB-C, 1x USB-B, 4x USB-A hub, headphone jack
Dell U3419W - $750
34.1", 3440 x 1440 @ 60 Hz, IPS
2x HDMI, 1x DP, 1x USB-C, 2x USB-B, 4x USB-A hub
Dell U3219Q - $750
31.5", 3840 x 2160 @ 60 Hz, IPS
1x DP, 1x HDMI, 1x USB-C, 1x USB-B, 4x USB-A hub