I haven't checked git, but even if git uses exec*() directly and skips the shell (which I suspect it does), the problem still exists.
The issue isn't one of shell quoting, but one of ssh treating the argument list ["ssh", "-oProxyCommand=something", "remote-cmd"] not as ["ssh", hostname, command] but as ["ssh", option, hostname].