Make some optimizations in function creation configurable.