In fact, I installed a newer version of git-bash 2 days ago and I suspect the bash environment could condition this.
I understand you installed a new version of Git for Windows, which includes Git Bash. Newer versions of Git, starting with 2.35.2 and 2.36, including Git for Windows, are stricter about directory ownership: https://github.blog/2022-04-18-highlights-from-git-2-36/#stricter-repository-ownership-checks.
When you use git from Git Bash, you use the Windows program, even if you cd to the //wsl$/ mount. Git for Windows does not have any special code to deal with the permissions of the WSL mount, so that’s why you get the error. You can’t fix that without modifying the Git source code.
An alternative could be to use wsl git instead of git when in Git Bash, which would then use the Linux executable.
Or, as you wrote, just use git config --global safe.directory '*' to bypass that security feature if you do not consider yourself at risk.
[Editor’s Note: If you are using Windows Command Prompt, do not add single-quotes to the asterisk, i.e., git config --global safe.directory *.]