The helper get_witness_script is already available in the blocktools module of our test framework, i.e. there is no need to re-implement it in the signet miner script. Note that the cast from CScript to bytes is necessary for applying the += operator on the scriptPubKey later, which would fail for CScript:
File "/home/honeybadger/bitcoin/contrib/signet/miner", line 132, in signet_txs
txs[0].vout[-1].scriptPubKey += CScriptOp.encode_op_pushdata(SIGNET_HEADER)
File "/home/honeybadger/bitcoin/test/functional/test_framework/script.py", line 460, in __add__
raise NotImplementedError
NotImplementedError