Backport a fix from the 3.x branch for type issuess in recaptcha.
Review Request #12112 — Created March 7, 2022 and submitted
The recaptcha integration had a couple bugs with string types. This
change has already been made as part of a larger cleanup on the
release-3.x branch, but a user has been hitting this with the 2.x
releases so we should have it there too.
Ran unit tests.