[TASK] Remove strlen calls in the DatabaseConnection

Remove the strlen calls in the DatabaseConnection to avoid many
string length calculations for the small checks in the query
build process. Replace it with a string cast and not identical
operator.

Resolves: #55370
Releases: 6.2
Change-Id: I0c175671ed51ab3034ffae7c0b812a90218e9f58
Reviewed-on: https://review.typo3.org/27077
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters