To answer your first question, yes, you can do this compilation under WSL.
For other questions, take a look at MinGW. Here is what Wikipedia writes for MinGW:
MinGW has been forked since version 1.3.3 of Cygwin. [5] Although Cygwin and MinGW can be used to port Unix software to Windows, they have different approaches: [16] Cygwin aims to provide a complete POSIX layer that includes the full implementation of all major Unix system calls and libraries. Compatibility is considered higher than performance. MinGW's priorities, on the other hand, are simplicity and performance. Thus, it does not provide specific POSIX APIs that cannot be easily implemented using the Windows APIs such as fork (), mmap (), and ioctl (). [16] Applications written using a cross-platform library that is itself ported to MinGW, such as SDL, wxWidgets, Qt, or GTK +, are usually compiled as easily with MinGW as they are with Cygwin.
Windows programs written with Cygwin run on top of the copyleft compatibility library, which must be distributed with the program along with the source code of the program. MinGW does not require a compatibility level, since MinGW-based programs are compiled with direct calls to the Windows API.
( https://en.wikipedia.org/wiki/MinGW )
This is what the MinGW webpage ( http://www.mingw.org ) says:
MinGW, short for Minimalist GNU for Windows, is a minimal development environment for native Microsoft Windows applications.
MinGW provides a complete set of open source programming tools that are suitable for developing native MS-Windows applications and that are independent of any third-party C-Runtime DLLs. (This depends on the number of DLLs provided by Microsoft itself, as components of the operating system, among which the most significant are MSVCRT.DLL, the Microsoft C runtime library. In addition, streaming applications must come with freely distributed DLL stream support, provided as part of MinGW).
MinGW compilers provide access to Microsoft C runtime features and some language-specific runtimes. MinGW, being a minimalist, does not and will never try to provide a POSIX runtime environment for deploying POSIX applications on MS-Windows. If you want to deploy a POSIX application on this platform, consider Cygwin instead.
I am more familiar with WSL and Cygwin than with MinGW. From what I know, MinGW is more focused on creating reasonably portable high-performance Windows binaries, while Cygwin is more focused on Unix users (or those who want to port applications written for Unix / POSIX) who want to use Unix- similar environment in windows with all departments. As you pointed out, Cygwin programs, at least, were less easily distributed to others who did not have Cygwin (due to licensing reasons, but see the Link below). MinGW programs run as native Windows programs using undocumented native Windows libraries. WSL binaries do not run on Windows on their own; they run only in the WSL environment (or, possibly, in native Linux systems). WSL maps the Linux kernel to calls to the Windows kernel, while Cygwin implements calls to the Unix / Posix library. WSL relies on a true Linux distribution to provide its environment, while Cygwin relies on its own environment. (WSL has the advantage that it will run existing binaries without recompiling.) I do not think this is too important for you because you do not plan to distribute your binaries. You want high performance. According to Wikipedia, MinGW is better performance than Cygwin, but it is also 32-bit, which can be a problem with your applications. There is a 64-bit environment similar to MinGW, but this is a different project.
The important point is whether you want to write Windows code or Unix / Linux / POSIX code. MinGW is designed to develop Windows applications using the Windows API (although you can reset limited POSIX support); WSL and Cygwin are designed to develop Unix / Linux / POSIX applications. It matters for mobility. But if you are developing types of programs, I think that you, almost all direct calculations and very few fancy I / O operations, it can simply boil down to personal preferences or convenience. If you can come up with a small representative program that takes a considerable amount of time and tries to run it in each environment, you can find out which one has the best performance. It will depend on what I think of your own combination of operations.
See also What is the difference between Cygwin and MinGW?