If you want to hide your Python source code, there are multiple options. You can pack your application into a single executable binary using external tools like py2exe, cx_Freeze and many others or natively with pyinstaller. Such single executable in fact is an archive with all necessary component to run the application without installing Python on the target machine.
For x86 there is a compiler, NUITKA which creates C source code, so you get a real executable but it is not available on ARM and I haven't seen such.
There are compilers to create JS code. If you find a solution how to protect Java Script code, it can be a solution.
To bind to a specific serial number, you can use an SHA1 hash of the serial number or to encrypt it with a symmetric Diffie-Hellman to encrypt the serial number. You can do it with openssl.
It makes harder to get access to your code or to reverse engineering how it works, to run on other hardware. Still it is possible, all depends on how valuable your application, is it worth enough to crack it. Next level is a hardware key or online license verification. Spend some time to read literature.