> Not sure why the Windows version would be much bigger than the bare metal one.
That's probably because there's a bug in the linker, which puts uninitialized variables in the data segment instead of bss. This means unlike the bare metal variant, the Windows executable is full of zeros.
This is a well known bug (see https://github.com/msys2/MINGW-packages/issues/18612 for example) which also affects my projects: https://gitlab.com/bztsrc/skandi The Linux CLI version is 216K, the Windows CLI version is 5.4M and the only difference is the lack of bss.