Short version:
cd /tmp
wget 'https://www.sqlite.org/2024/sqlite-amalgamation-3450000.zip'
unzip sqlite-amalgamation-3450000.zip
cd sqlite-amalgamation-3450000
gcc -dynamiclib sqlite3.c -o libsqlite3.0.dylib -lm -lpthread
DYLD_LIBRARY_PATH=$PWD python3 -c "import sqlite3; print(sqlite3.sqlite_version)"
That prints "3.45.0" for me.If you have https://datasette.io/ installed you can then get a web UI for trying it out by running:
DYLD_LIBRARY_PATH=$PWD datasette