I have done this on linux (and I guess it shouldn't be that far out on Mac OS X) where I just unloaded the USB modules related to HID. usbhidusbhid was one such module
This would of course rended any hid devices unusable and you will need another way (like remote access) of getting access back.
Unplugging and plugging the keyboard/mouse may also restore service.