For the ESP32, the arduinoespressif32
framework provides soc/rtc.h
which we can use to modify the CPU clock, howver that chip runs at 160 MHz or 240MHz.
The XIAO only runs at 48MHz, however I would like to slow it down further, because I need to use an HX711 which has quite a slow (200us) data rate