In the cases where end-to-end vendor control over the hardware from the player's fingers to the HDMI out exists, yes that seems possible.
But on a PC? Where the user can install whatever software they like? Much harder.
It feels like stopping aimbots will ultimately fail as eventually we'll see bots that use machine-vision to spot heads and pick them off. You wouldn't even need to run it on the cheating machine, this could be a separate device doing passthrough on the mouse, keyboard, and monitor.
It seems winnable so far if you look at the Xbox One and later, at least. I'm not aware of anyone successfully modifying game code on those consoles.
The downside is that it a requires a completely locked down system.