```
This allows us to make it const.
```
Partial backport of [[https://github.com/bitcoin/bitcoin/pull/22791 | core#22791]]:
https://github.com/bitcoin/bitcoin/pull/22791/commits/f572f2b2048994b3b50f4cfd5de19e40b1acfb22#diff-b1e19192258d83199d8adaa5ac31f067af98f63554bfdd679bd8e8073815e69d
Depends on D12292.