string_ref is meant to be ephemeral, because it doesn't own the characters. It's great for passing parameters (because the storage will definitely survive until the function returns), and for function return values in limited cases (when the storage is not allocated by the function, so will survive return and immediate assignment to an owning type -- an ideal use is returning a string_ref from a 'substring' function, where the return is guaranteed to be a subrange of an input). But it's very dangerous to use them in situations where the string_ref might outlive the owner of the characters, so in general we discourage the user from declaring a string_ref variable, and that's exactly what this would require.

An example in this case would be, suppose you stored the attribute as a string_ref variable belonging to the caller. Then you destroy the ImageSpec, or TextureSystem, or whatever owned the attribute in the first place. Suddenly, your string_ref refers to unallocated memory (or has been written over, or whatever. Not good.