In my opinion, "direct hardware access in Nim" means File System API, Socket API written by C. There are equivalent wrappers in Python (written by C and wrappered by Python).
If you want to write some "direct hardware access" low-level API, you should comply with the specification of these C API.