refactor: Make const refs vars where applicable and enable related clang-tidy checks
Summary:
This avoids initializing variables with the copy-constructor of a non-trivially copyable type.
Automating this check can save us some brain bandwidth during reviews.
This is a backport of core#25707
Depends on D18072
Test Plan:
cmake .. -GNinja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DENABLE_CLANG_TIDY=ON ninja all check-all`
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Subscribers: Fabien
Differential Revision: https://reviews.bitcoinabc.org/D18073