If you're on Linux you might be able to use a combination of modprobe + udev + systemd unit files to hardcode a solution.
Either you hardcode your keyboard and mouse absolutely into kernel parameters, or you make two systemd unit files: one that runs with before suspend and one that runs 'before' resume.
You make the before suspend unit file manually temporarily disable USB enumeration. And the before resume unit file enables it again.
This trick at least works with Gigabyte Aorus 5XX motherboards that have an infamous suspend bug, where any used PCIe SSD slot would prevent the system from properly suspending and you have to disable the slot temporarily.
Also, always check the NixOS repo for stuff like this. In some ways it has started to rival or even surpass the Arch wiki for finding workarounds for hardware quirks.