[clang-tidy][NFC] Fix a couple of suspicious StringRef::data() usages (#158480)
Closes https://github.com/llvm/llvm-project/issues/156150
Updates a couple of clang-tidy checks to use C++17 `std::string` member
functions that accepts a `StringViewLike` template parameter.