I'll one up this with my hack that changes the value of `sys.platform` based on the caller: https://github.com/jvolkman/rules_pycross/blob/main/pycross/...
This is used when cross compiling binary wheels (e.g., building a macos wheel on a linux build host or vice versa).