Oh boy. You're going to hate to know what programming language is used for apache, nginx, postfix, postgres, MySQL/mariadb, redis, wireguard and the majority of network hardware.
For services that can't be avoided, I try to limit their exposure. I run Postgres with strictly controlled network access. Same for Redis.
What else? I'm also using Hickory for DNS. I replaced the stock OpenSSH with a version compiled using Fil-C.