If you put for example postgresql on equal footing, application and database in the same server (over unix sockets), then I guess 200 SQL statements is not a problem either for the timeline example.
Wouldn't it still be over the network/IPC, unlike SQLite?
No. It will be internal port to port connection. And it also depends on the driver. You can definitely have a crappy SQLite driver for your obscure OS that can absolutely take a lot of time for those 200 queries.
It is still IPC (inter-process communication) even though it wont go over any network. Probably still order of magnitude more overhead than a function call, but quite possibly it will be acceptable.
None is stopping you to write a PGSQL driver that uses memory-mapped files and then your calls are as fast as a function call.