refactor: Replace &foo[0] with foo.data()
Summary:
Rationales from the PR description:
- In CSignatureCache::ComputeEntry, change the way a vector pointer is resolved to prevent invoking undefined behavior if the vector is empty.
- Sometimes alternative code without any raw data pointers is easier to read (refer to the respective commit message for details)
- If the raw data pointer is needed, foo.data() should be preferred, as pointed out in the developer notes.
This is a backport of core#21817
Test Plan: ninja all check-all
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Subscribers: Fabien
Differential Revision: https://reviews.bitcoinabc.org/D14826