refactor: use std::string for index names
Summary:
This concludes backport of core#25971
https://github.com/bitcoin/bitcoin/pull/25971/commits/200d84d5681918523d982b9ddf60d1127edcb448
Depends on D17706
Test Plan: ninja all check-all
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D17707