Lambda runs a custom compiled interpreter with different flags set than most distros. In this case they don't compile python with optimizations on, which is weird, and they link an old version of SQLite.
I'd guess they'd run in firecracker VMs (a technology they open sourced), targeting faster starts. And perhaps turning off the compile time flags also results in a faster-starting binary, which is the more important metric for serverless, maybe at the expense of slower code/longer runtime, excepting that runtimes are on average quite short anyway.
Ah true - the longer the execution time the more money they make.
I guess the different flags makes sense - the VMs Lambda runs on run Amazon Linux as far as I understand. But turning off optimisations does seem strange.