Which most systems, even 64-bit ones, still define as a 32-bit int, which overflows in 2038. This is a widely-known bug.
25 years might seem like a long time away, but if you got a 30 year mortgage recently, you can't use dbi_conn_result_get_datetime() to retrieve the end-date from a database.
According to the link that you provided there is no one-size-fits-all solution to this problem. I suggest using an OS which defines time_t as a 64-bit integer. My 64-bit FreeBSD box does so, and NetBSD and OpenBSD even provide 64-bit time_t on their 32-bit OS versions. I don't know how Linux deals with this problem, but you should be able to find an OS that works even for your mortgage calculations.
Wrong answer from a library provider. I guess we (Gnucash) will have to find a different SQL abstraction library, because we're not going to drop support for the OSes that most of them use.
...or suggest a fix that works on all supported OSes without breaking backwards compatibility.
Should be pretty simple: You just need to pinch the 64-bit gmtime code from FreeBSD. It's all implementation detail in libdbi, because your time function returns a struct tm, not a time_t, so it's transparent to callers as long as it works.