Identify global state performance bottlenecks. Create a proof-of-concept implementation, and measure the performance impact.
pyperf
is a good tool for benchmarking.
I’m only aware of one change related to PEP 687 (heap types and module states) and performance: the _functools extension store some objects in instances to avoid instance -> type -> module -> module state
lookups: commit IMO when performance matters, it’s a reasonable trade-off.