Prototype API for log redaction
Created by: varungandhi-src
Implements what I describe in my comment earlier.
The PR is written for commit-by-commit review.
We don't need to merge this if we think that this is the wrong direction to go in, but I figured it'd be easier to understand the proposed changes with actual code rather than without.
(I'm not attached to the specific names of the different types, cases etc; feel free to suggest alternate names.)
Test plan
Added tests for non-trivial new functions.