[BUG #7876] add ability to log 'statics' optimized methods at runtime

- as a debugging feature (activate in featureoptimizer.py::prune_dont_log)
- if 'prune_dont_log' is set to False, methods will not be pruned but augmented
  with a log statement at the beginning (like "static opimization would have
  removed this")

Caveat:
- this has only limited scope in the context of static optimization
- it only insert logging for functions, but the optimization also prunes data
  features e.g. maps
- it doesn't decrement the ref count on dependee features, so as not to
  'empty' a class, which would then be removed entirely
- so methods that would have been removed transitively are not instrumented
  to log