Whether it's "safe" or not depends on the caller, just like any string function in D that returns a slice of any of its arguments, which is something like half of the functions in `std.string`. The function will always be an unsafe operation because it's the responsibility of the caller to make sure the C string passed is null-terminated (which is the inherent problem with the shortcut in `to!string`). The function clearly documents that it returns a slice of the argument, so it's perfectly consistent with the rest of `std.string`.

`fromStringz` retains the mutability of its argument so it's not like the caller ends up with the convention-ridden `string` unless the rarely seen `immutable(char)*` was passed, in which not copying the result is likely perfectly correct.

The `to!string` shortcut is a terrible design decision and it should instead be consistent with `formattedWrite`. The fact that it unconditionally makes a copy while other parameter types for `to!string` may intentionally avoid a copy based on mutability is also a bad design decision. Having the broken, deceptive `to` as the only alternative in Phobos for doing this common operation is what makes `fromStringz` so desirable, regardless of whether `to!string` is fixed or not.