is to_indext_string() not \0 safe?
It still feels very odd that we don't get the length from to_index_string()