JS_GetStringCharsZ returns chars the string actually "owns" (in the sense that they're not chars from some string it depends on). But it returns chars that are const. JS_GetStringChars returns chars that could well come from the string ours depends on, but it doesn't return const jschar*. JS_GetStringChars should almost certainly return const; can't speak to the other.
JS_GetStringChars was removed in http://hg.mozilla.org/mozilla-central/rev/cc6d97b432cc (bug 609440) JS_GetStringCharsZ was removed in https://hg.mozilla.org/mozilla-central/rev/0f25f3ccb7b3 (bug 1037869)