Make std::vector and prevector reuse the VectorFormatter logic
Summary:
This is a partial backport of Core PR18021 [3/4]
https://github.com/bitcoin/bitcoin/pull/18021/commits/3cd8ab9d11e4c0ea47e56be4f6f2fdd48806796c
Depends on D8743
Test Plan: ninja all check-all
Reviewers: #bitcoin_abc, majcosta
Reviewed By: #bitcoin_abc, majcosta
Differential Revision: https://reviews.bitcoinabc.org/D8744