Here's something that might work for you.
It's not a USB-C cable but put a couple USB-C adapters on each end and pretend it is. They claim the cable allows KVM features but my guess is that it's just no different than any of a number of similar cables that emulate an Ethernet connection at 5 Gbps and the rest is just software. An Ethernet or Wi-Fi connection could do much the same but because of the lower bandwidth it would not be nearly as responsive.
Another example of this kind of cable: https://web.laplink.com/cables/
One more: https://plugable.com/products/usb3-tran/
That last link will actually peel back the curtain and admit they use a Prolific PL-27A1 chipset to make the connection, which all those cables likely do. These cables will not transfer power, only data, so for now you have to choose one or the other. The actual KVM function they advertise with these cables is just software, it requires installing and setting up software on both computers before it can work.
As demonstrated by you seeing your MacBook as a billboard device on your PC the MacBook has all the hardware it needs to become a functional USB device to another computer. This can be demonstrated further by putting your MacBook into Target Disk Mode and it's internal drives will appear as a USB storage devices to another computer connected by a USB-C to USB-C cable or USB-C to USB-A cable. I did this with my own MacBook Pro so I could get files on my brother's MacBook, for some reason we couldn't network the computers so we used Target Disk Mode instead. I'm considering getting one of those cables I listed above in case this situation comes up again, Target Disk Mode is nice but it requires shutting down the Mac and booting into this mode to work.
So, you have one means of using one computer as a KVM to another, that's with one of those cables I listed above and some screen sharing software. Another means is for someone to write drivers and software that would allow a computer to advertise itself as human interface devices to another. Some embedded systems already do this. They use all the same USB chips that are in laptops, tablet computers, and some desktop PCs, so the hardware is nothing special. The difference is in the software.
There's people that will use Linux and "USB gadget" drivers to make the USB-C ports on their computer emulate virtual Ethernet, serial, or storage devices to another computer. Getting keyboard and mouse "gadgets" would seem nearly trivial after that.