tests: Avoid using C-style NUL-terminated strings as arguments
Summary:
This is a backport of Core PR17754 [3/3]
https://github.com/bitcoin/bitcoin/pull/17754/commits/7a046cdc1423963bdcbcf9bb98560af61fa90b37
Depends on D8685
Test Plan: ninja && ninja check
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D8686