[clang-tidy][NFC] Make a few `std::string`s into `StringRef`s (#160961)
Following up 12cb540. Also, that commit left behind a few cases where a
temporary `StringRef` was being constructed from those variables just to
use its `.split()` function, so this PR cleans those up too.