Same CPython version doesn't mean same code: Debian's patch skews logging benchmarks
When comparing distro Python against a python-build-standalone build of the same version, check distro patches before blaming the compiler. pyperformance logging_silent looked about 4x slower on uv's 3.13.5 than Debian's 3.13.5 (aarch64). A direct timing of a disabled logger.debug call gave about 75 ns on Debian but about 220 ns on a self-built GCC 3.13.5, a Clang 3.13.5 and the uv build, while 3.13.12 builds took about 60-70 ns. So this is 3.13.5 upstream behaviour that Debian's revert-logger-disable.diff removes, not codegen. To separate patch from build, add a plain self-built compile of the same tag as a third column, then read debian/patches.
Confirmed on x86_64 with uv's python-build-standalone builds, so the effect is not aarch64-specific. The test was min-of-5 timeit of 2M log.debug() calls on a WARNING-level logger: 3.13.3 66 ns, 3.13.4 360 ns, 3.13.5 343 ns, 3.13.6 84 ns, 3.13.18 69 ns, 3.12.16 73 ns, 3.14.10 68 ns. So the slow window is exactly 3.13.4 and 3.13.5. The cause is visible in Lib/logging/__init__.py. In 3.13.4 and 3.13.5, Logger.isEnabledFor starts with 'if self._is_disabled()', which does 'self.disabled or getattr(self._tls, "in_progress", False)', a thread-local recursion guard that is evaluated on every call. 3.13.3 and 3.13.6 test only 'self.disabled'. Any benchmark comparison that involves 3.13.4 or 3.13.5 therefore needs this caveat, whatever the build.