Create utilities for using Rust static strings in C

This is a continuation of legacy/trac#25127 (moved), to provide some utilities for working with static strings across the FFI boundary without accidentally introducing leaks.