Oh, heck no. I love to explain a bit more in depth. I can tell when folks want to argue physics with me.
You're right that there are indeed many capacitors that can act as miniature batteries and keep a module alive for a few seconds or even minutes after the battery is disconnected. And many (not all) of them are connected to the 12V power pins and those capacitors can be discharged faster by shorting out the battery cables on the vehicle side. Sensors are often powered by a 5V output from the PCM, BCM, HVAC controller, ABS controller, or TCCM. But codes are generally of two types - ones that get stored in non-volatile (meaning permanent) memory, and those that are real-time codes. Non-volatile codes like almost anything emissions-related, will never get cleared by a battery disconnect or by discharging the capacitors. If they were, then anybody with a SES light and a code who needs to pass an emissions test would simply disconnect the battery and clear the code, then scoot in for the emissions test. The EPA wouldn't allow that, so codes are stored in protected non-volatile memory and can only be cleared by fixing the underlying problem. Or by a code clearing scan tool, but then the emissions test will still fail because a freshly-cleared code won't have accumulated sufficient "drive cycles" after the code was cleared for the EPA to consider it legitimate. So you can't clear codes with a scan tool around the corner from the test facility, then scoot in and pass. You have to drive around for a couple of days, and if you haven't fixed the underlying problem, the code will come back.
In the case of the HVAC controller and the TCCM for your encoder motor problem, those modules don't have non-volatile memory for some of the parameters (they do for others), so a loss of power will trigger a recalibration process. That recalibration process fixes quite a lot of encoder motor and HVAC actuator problems (not all), but the modules would be triggered to run a recalibration process by even a minute of no power. Shorting the battery cables together isn't necessary. It won't hurt, but it's not the real reason the encoder motor got fixed.
30 minutes of battery disconnection should be identical to 30 seconds of battery disconnection combined with a power cable short. No capacitors in the modules are going to retain an effective charge through either of those two procedures.
I hate to admit it, but I worked on designing a test system for integrated circuits, that was repurposed to test Ford PCMs, around the 1993-4 time frame. Was able to learn (under a non-disclosure/secrecy agreement) almost everything about the internals of Ford engine control modules at the time, 95% of which are the same sort of circuits used in everybody's PCMs, since they all have to pass the same sort of EPA tests. So that's where I get some my "insider knowledge" of PCMs, even though I didn't specifically learn GM or GMT360 PCMs or how to tune them. Sigh.....