I just happened to notice this while looking for a an already implemented wsl-browse-url (thanks!), so will offer one other option:
(when (string-match "-[Mm]icrosoft" operating-system-release)
;; WSL: WSL1 has "-Microsoft", WSL2 has "-microsoft-standard"
It looks like that works on both my Debian WLinux WSL 2 environments.