Windows has a very different file permission model to Unix and integrates them only minimally.
Here's how Windows calculates the bitmask...
u+w/g+w/o+w is set based on whether the file has the read only flag.
u+r/g+w/o+w is always set.
u+x/g+x/o+x is set based on whether $filename is an inherently executable file (e.g. bat) or a directory.
Windows isn't integrating its ACLs at all.
Here's the source of all this: https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/stat-functions?view=vs-2019 (but it doesn't provide many details)