error is a low-level function with a sole dependency on LogPrintf, which
is defined in logging.h
The background of this commit is an ongoing effort to decouple the
libbitcoinkernel library from the ArgsManager defined in system.h.
Moving the function out of system.h allows including it from a separate
source file without including the ArgsManager definitions from system.h.
This concludes backport of core#27238
https://github.com/bitcoin/bitcoin/pull/27238/commits/aaced5633b81b2f08b993106a527e2a0e1d663c1
Depends on D16149