perf(config): literal-suffix reject and prune irrelevant globs per base (#35688)
Two follow-ups to #35039, both on the file-discovery hot path shared by
`fmt`, `lint`, and `test`. #35039 already precomputes a pattern's
literal base prefix and matches against the shorter relative path; this builds
on that with the two remaining ideas from #21830.
Closes #21830