I got annoyed at my fan speeds so decided to experiment with controlling my fans with Python and measuring the results.
You likely have a setting for fan ramp time in your bios, usually in seconds. So setting your pump to always run at 100% and your fans to ramp slowly, say 10 seconds or longer, and using a minimum fan speed that is as high as tolerable would likely work as a no-additional-code solution.
Setting your AIO pump to static full power will greatly increase the idle power consumption of the machine.