pub fn new_forward_slashes(buf: impl Into<String>) -> Self {
        let mut buf = buf.into();
        // Change all `/` to `\` on Windows.
        if std::path::MAIN_SEPARATOR == '\\' {
            buf = buf.replace('/', "\\");
        }
        Self::strip_trailing_null_byte(buf)
    }
Creates a new instance of `Utf8Paths0`, converting `/` to `\` on platforms like Windows.

Some tools like Git (but not Mercurial) return paths with `/` on Windows, even though the
canonical separator on the platform is `\`. This constructor changes all instances of `/`
to `\`.
tools/determinator/src/paths0.rs