MDEV-18778 (10.2) broke using the output in embedded server mode (and no-one noticed) because the SQL generated required the delimiter parsing in the client.
MDEV-23326 (10.4) didn't do a LOCK TABLES in the non-skip_write_binlog branch of the code and should have.
The --skip-write-binlog option from
MDEV-18778 that doesn't always skip-write-binlog is just horribly confusing. As Brandon Nesterenko said, what breaks? "explicitly providing --skip-write-binlog, but actually wants mysql-tzinfo-to-sql to be binlogged".
Lastly, we could make the SQL generated preserve the session SQL_LOG_BIN state.
There's also a 10.6 case with wsrep_mode=REPLICA_ARIA where there isn't a need to change to InnoDB for replicating, but its a fairly minor case.
Using user variables and EXECUTE IMMEDIATE prevents the need to use delimiter or a stored procedure.
Some test cases from a previous MDEV-23326 draft may be useful.
A 10.3 fix by moving SQL_LOG_BIN=? out of the WSREP_ON=ON condition.