The relationship between patch 0001 and 0002 is unclear to me. Are
these incremental or alternatives? The description doesn't make this clear.
Some of the changes in patch 0002 just appear to move code and comments
around without changing anything substantial. It's not clear why that
is done, as it's not related to what the patch claims it does.
The main tests for the bytea type input formats are in
src/test/regress/sql/strings.sql, so you should add any new tests there.
Maybe there are already enough tests there that you don't need any new
ones.
Overall, I would consider the bytea "escaped" format kind of
obsolescent. But if you want to make it a bit faster with little other
impact, why not.