We do substitution on SQL queries in TCL before passing them off to the driver, that could be one source of the difference. You could turn this off easily enough by finding the "subst" command that does this.
We also do massaging of Tcl variables passed in as pseudo-bind vars, double-quoting and escaping backslashes. That can be avoided by using literals directly.