Since commit 9ccf3e9b22 Git has had both core.commentChar and core.commentString. As that commit notes, it can be useful to keep commentChar as a single character for compatibility with older Git when commentString is multi-byte. This leaves scripts needing a pipeline over git config --get-regex '^core.comment(char|string)$' and sed to find out what Git will use. Phillip Wood's patch adds GIT_COMMENT_STRING to git var.
Junio C Hamano said it is unfortunate that the two variables follow a last-one-wins rule, which would otherwise have been a simple matter of using commentString and falling back to commentChar. He said the motivation is good.
Kristoffer Haugsbakk suggested the commit message say "comment string" rather than "comment character" and that it mention the config variables and git-config(1). He also read the tests as covering the default and commentString overriding commentChar, and thought that covered the testing bases.
He also showed that an invalid empty core.commentString makes git var GIT_COMMENT_STRING report an error and exit non-zero. Phillip Wood has since reposted the patch.