GitHub won't let me comment on lines that aren't part of the diff, but the comment at the start of this block

    // Custom Trimpath modifiers, used for security related escaping purposes

isn't accurate anymore since the new modifier isn't security-related