Unfortunately there isn't a way around this issue.
My site has both light and dark themes, as well as a default 'base theme'. Whenever a theme is selected it will load the 'base' theme first (which has a white background) and then apply the appropriate dark or light theme on top of it.
The flicker of white you see is the base theme being loaded before being covered up by the selected theme and its related background.
I don't think there is really a way around this issue -- the only thing I can do is maybe set the 'base' theme to have a black background so that