By a wild coincidence, someone blogged discussing a similar question today. They discuss a number of factors I hadn't thought of, including using prepared statements rather than raw SQL commands. Here it is: <https://avi.im/blag/2021/fast-sqlite-inserts/>