Okay I've finally found the manual page mentioning that feature:
https://dev.mysql.com/doc/workbench/en/wb-sql-editor-query-panel.html
It is possible to enter a function, or other expression, into a field. Use the prefix \func to prevent MySQL Workbench from escaping quotation marks. For example, for the expression md5('fred'), MySQL Workbench normally would generate the code md5(\'fred\'). To prevent this, enter the expression as \func md5('fred') to ensure that the quoting is not escaped.