No changes in behavior. Just replaces arguments and return types
This is a backport of [[https://github.com/bitcoin/bitcoin/pull/19619 | core#19619]] [3/8]
https://github.com/bitcoin/bitcoin/pull/19619/commits/0d94e6062547f288a75921d2433458a44a5f2297
Depends on D10225