You have to handle NULL in C, or your program crashes (though I suppose a misguided optimization of strcmp could do "a == b || really_strcmp(a, b)", which gets us back to your bug).
Also, in things like rust you can just do result.unwrap() if you want. In general, language constructs don't really save you from bad programmers.
> a misguided optimization of strcmp could do "a == b || really_strcmp(a, b)",
In practice, that's less of a risk than:
Or code for which pointer identity is relevant (e.g. accessing slices/subparts of a data structure): And for sure there are much better ways to write both kinds of code! But people routinely do not do that.