As discovered when working on #57880, for XSSF, creating 33,000 cell styles is 30 times faster than creating the same number of format indexes. For 5,000 cell styles and formats, creating the cell styles is only 3 times faster than creating the formats.
In r1677368 I've made a few changes which gives a 3x speed improvement on creating 33,000 data formats in XSSF. It's still slower to create the formats than it is to create cell styles, so there may be some more optimisations to do