What I've very often done is use command line tools like compilers, search&replace etc inside WSL2, in a Windows terminal. You have the benefits of speed and all the CLI tools of the Linux world. And then have the GUIs, like vscode, running on Windows. Vscode has its server running on the WSL side, so still very good performance.
Best of both worlds, since the GUIs and the CLIs are tightly integrated.
WSL2 uses "disks" emulated via image files that are stored as ordinary Windows files (but in a secret place). This makes most file I/O from inside WSL2 faster than from inside WSL1.
WSL2 can use the Windows file system (and vice versa) via file servers.
When a Linux app inside WSL2 wants to use a Windows file, the Linux kernel (there is only ever one for all running WSL2 images!) talks to a Windows app that does the file serving.
When a Windows app wants to use a Linux file from a WSL2 image, the image first has to run (might take a little while for it to boot) and then a daemon there serves the file to the Windows app.
I think one of the file servers use a version of the 9P protocol. Maybe they both do.
https://en.wikipedia.org/wiki/9P_(protocol)
Things that do lots of file I/O (such as compiling) are way faster under WSL2 using local file systems than under WSL1.