C API's Leanest Ephemeral Data: Avoiding Python Object Bloat

By directly allocating raw memory using the C API, extensions prevent the memory bloat associated with Python objects (e.g., reference counts, type metadata), leading to a significantly smaller memory footprint for short-lived data.

Sources

Open the full topic