This PR is a follow-up to #22363 and #23118 and introduces a helper keys_to_multisig_script for creating bare multisig outputs in the form of
OP_K PubKey1 PubKey2 ... PubKeyN OP_N OP_CHECKMULTISIG
The function takes a list of pubkeys (both hex- and byte-strings are accepted due to the script_util.check_key helper being used internally) and optionally a threshold k. If no threshold is passed, a n-of-n multisig output is created, with n being the number of passed pubkeys.