ESP32: How can I shorten wifi-connection time to AWS?
You can't shorten the connection time by much. Reconnecting to WiFi then reconnecting to AWS IoT Core takes a bit of time. You're authenticating to the WiFi base station, then connecting MQTT to AWS with certificate authentication and then (assuming you're using Shadows) the device is syncing the shadow. It takes time on a tiny device.
That said, you could potentially bring down the time by increasing WiFi power in menuconfig (assuming you're using IDF) but that probably would end up in a wash. It would spend slightly less time but spend more power. But you could try it and see what happens.
My recommendation which doesn't answer your exact question but more the idea of battery saving: You could amortize the cost of the power hungry WiFi if you don't need the sensors continually running. You can put the chip in sleep mode which turns off radio, CPU, and RAM. There a couple of sleep modes (deep and light mode) in ESP32. With a properly designed power supply, the chip will only consume a few uA of quiescent current when sleeping which leaves more power for WiFi to later consume. Also note you'd need to take special care of saving state in RTC or NVS memory if needed. Coming out of sleep is almost like a reboot. If you don't want to do this what you could benefit from is ESP32's Power Management API.