So it seems you can register a source transformer with python which will trigger when a `# coding: ...` header is used (to signal character encoding).

This seems like an interesting avenue for static analysis tools, code generators, (etc.) to explore. Is it a viable approach?

I'd be interested in some analysis on this as a mechanism: performance, maintability, etc. wise.

The "dont do this" argument writes itself; nevertheless, its worth exploring.