clap is a popular command line argument parsing crate. Clap requires the ability to peek into an &OsStr, for example, to see if the arg starts with - or --. It is desirable for Clap to operate on &OsStr instead of &str because native platforms do not limit command line arguments to &str.
I believe parsing arguments from the command line to be a common use case, of which determining switches and flags is part of the task. Is adding an OsStr::starts_with API something the libs team would be interested in?
I am not a team member but I have seen that suggestions like this seem to normally be encouraged to be created as a straight PR where the function is unstable behind a gate. Given that this method is already on &str it seems very reasonable that it would be accepted.
It's part of RFC 2500, which has been sadly stalled for quite some time. Perhaps it can still be added now in a way that would be forwards compatible with the RFC though.
I've dealt with the same problem in my configure_me crate which aims to be a replacement for clap in some situations.
The methods for parsing &OsStr arguments and detecting if they contain -- are actually separated into a small parse_arg crate, so clap is free to use them without waiting for addition to std. See parse_arg::match_arg