It is not possible to program a mouse or a keyboard in a completely "native" way, as both devices interact directly with the operating system (OS) and rely on its drivers and APIs to function. Any interaction with a mouse or keyboard, whether through libraries like pyautogui and pywinauto or through a script running on the device itself, would be detectable by the OS.
That being said, some gaming mice and keyboards come with software that allows you to program macros and key bindings, which can automate certain tasks within games or other applications. These macros and key bindings are typically stored on the device itself, so they can be used without running any additional scripts or software on the OS.