Prepare path sanitizer for #10671 configurability.