Making a new linker option is much easier. You can even use the import facility to put your new operation in any file you want (e.g.: your config.py file).
The operation interface is very simple; it has one method: execute(self, ast) which returns nothing (the AST is modified in-place). Within your execute method, you can do whatever you like to the AST. For example you can rename methods or classes, simplify function parameter types, check the comments and perform actions based on those, etc.