[backport] Fix for BCHN issue #440 (decodepsbt failure to decode BIP32 keypath)
Summary
Fix for BCHN issue #440 (closed) .
Backports of D6029 and D6030, and related regression test steps, plus additional regression test case from !1622 (closed) integrated into rpc_psbt.py.
A quick check for invalid base64 has been added in the spirit of upstream because it is needed by part of the backport regression test change. Some of the function signature changes in strencodings.cpp (changing return type to a std::optional) have not been backported yet so this check is slightly modified to pass a flag through a bool pointer as our current interface demands.
Test Plan
cmake .. -GNinja -DENABLE_WERROR=ON
ninja check-all
D6029 is a backport of Core [[https://github.com/bitcoin/bitcoin/pull/14689 | PR14689]] Differential Revision: https://reviews.bitcoinabc.org/D6029
D6030 is a backport of Core [[https://github.com/bitcoin/bitcoin/pull/14690 | PR14690]] Differential Revision: https://reviews.bitcoinabc.org/D6030
Merge instructions: DO NOT SQUASH