&str
is definitely idiomatic. It's just a tradeoff. Having the best performance often means taking more space and Rust is usually optimized in that direction.
If it helps take up less space then passing &&str
to the panic functions could make sense as its the slow path.