The easiest solution is likely PackageCompiler.jl, should work with all Julia code (there are very few exceptions, I believe LoopVectorizaion.jl is (only?) one, too technical to get into here why but it’s only to provide speedup, so not strictly needed).
PackageCompiler can be used in several ways, not just to compile full apps, also libraries, or to sysimage, what you want, seemingly. I believe all the ways have some drawbacks, mainly the app or library is not going to be tiny (100+ MB if I recall realistic). It’s rather large but can be made smaller through non-default options. First is to check if this works at all for you.
Compiling with it, even for a full app, will not provide you with just one .exe file, but a folder of files, but I’ve seen a YouTube video about how to use it and make a (Windows) installer (i.e. one file), I don’t think it’s outdated, but you need to do things a bit differently (also because of Python):
You can find some ways elsewhere how to distribute Python apps (without Julia) as an .exe, but they might be incompatible with PackageCompiler. I suppose Python itself, and your Python code can be incorporated into the builder as explained above.
What is your goal with “the need to compile it as a static executable”? Is it just easy distribution (and/or) fast startup (“TTFX”) of Julia? Or to hide the source code (it’s possible with non-default Julia options, otherwise it will be bundled with)?
It’s very possible you don’t actually need to AOT compile Julia, and then I would suggest juliacall (part of PythonCall.jl), a PyCall replacement, that will download Julia for the Python user.
StaticTools.jl is another option, it only works with a restricted subset of Julia, but if it works (or if not, then with slightly changed Julia code), then you get tiny (on the order of kilobytes for a small demo) .dll (or .so etc.) or apps.