Every time I open Thunderbird I have to input my master password. In order to do that I need to unlock the local keyring (KeePassXC in my case) and copy/paste the password.
KPXC like many other keyrings implement the FdoSSP (Gnome keyring and KWallet do the same). In this case the master key could be automatically retrieved by Thunderbird when started by querying the database via DBus.
Can you implement it? In case an OS doesn't support the SSP like Windows or any Linux distro where the service is not exposed, then Thunderbird could simply ask the password with the usual prompt. In this case there won't be any breakage for those users.
If the OS provides such a service, the password prompt could add an opt-in check-box which says "Do you want to store the master password in your keyring?". If checked, then the password is store there and future Thunderbird instances can automatically retrieved it.