I'm afraid Python is not the language for anything that small. PyInstaller has to include a minimal working Python installation inside your program which is around 20MB - and that's before your code goes in it. Using the
--onefileoption allows it to compress some of it so you can get down to about 7MB. If you're determined, either translate your script in C++ or maybe try Nuitka which tries to do that automatically.