For extra credit on top of the webcam, you can also add a Fingerbot, and a pi pico with either an Ethernet port or a second USB port, so the host machine can talk to the target device as if it was a keyboard, and then also hard power it off via holding the power button if the work wedges the machine.
Surely it would be simpler+cheaper to use a smart plug to kill power, at least for devices without a battery (or where removing it is easy)