Filter out certain incoming MIDI messages?

Wouldn’t it be a good idea we could filter out certain incoming MIDI messages from being sent through?
That way we could for instance intercept a footcontroller midi CC message and exploit it for something else, without the original footcontroller message going through to the synth.

The same idea would be used to intercept a monophonic aftertouch signal, prevent it from being forwarded, and convert it in a polyphonic aftertouch signal which is then being assigned to the lead melody only (= Single Note AfterTouch).

I’ve done similar experiments on the E1 in my MIDI notes transmittor but to make it work without such filter, I needed to use a different outgoing MIDI channel, not the original incoming, which meant processing every single incoming midi message. That is a lot of coding.