So is Civ's AI hard coded into bunch of "if, then" clauses or does lack of DLL access means one doesn't even know how the AI code is phrased?
Lack of dll access means we can't see the code, correct.
But we do have access to xml files and logs, which betray a lot about the internal code. The system used also seems very similar to civ 5 codes in places, which suggests theres code reuse, and since we know the civ 5 code, we can infer some things.
It depends a bit on the system, but most of the internal civ systems use some kind of heuristics. For example building buildings, it calculates the worth of buildings based on the yields, then compares all the buildings and picks what it thinks the best one is. The desire for each yield can then depend on some factors
This is honestly probably one of the best approaches if done well, which it unfortunately isn't.
Internal diplomacy logic is a bit less clear. But it too seems to put certain values on items in a trade, and then calculates whether a deal is acceptable enough (also taking relationship into account)
Again, the problem isn't that it's a bad approach, it just doesnt seem to be tweaked very well. It doesnt make much sense to only accept 1 for 10 resource trades or something, even if you hate someone else, youll benefit from a 1 to 1 luxury trade.
Your declaration of war system actually looks a lot like what they used in civ 5, but they've done something entirely differently in civ 6. Luckily I'll be able to overrule (non joint) war declaration so I can try to build something better.
What you describe is computationally no problem. Usually you get into computational issues because of some algorithms with nested loops. Like, suppose you want to determine for every tile what the fastest path to every other tile is. Because of the large numbers of start tiles, the large number of destinations and the large number of possible paths you run into computational limits. A couple of small checks per turn for just one player is no big deal at all