I was able to reproduce on WSL2 so it might not be a Windows only problem. I do think it's a bug that should be reported.
Using `nm libfoo.a` or `nm libfoo.so`, it shows that main / premain etc. gets generated for both static & dynamic library but it's only a problem for static library.