Improve performance by removing unnecessary database queries

Options are persistent. You can set them when you activate your theme and then just use them. There’s no need to change them when rendering any particular page unless your logic actually changes them.

And doing so may cause confusion. For example, lots of changes to image and thumbnail default sizes will make your Media subsystem contain lots of generated thumbnails with sizes you don’t use any more.

Finally, consider using a persistent object cache. It significantly reduces database traffic for options and transients. Read all about it. https://developer.wordpress.org/reference/classes/wp_object_cache/#persistent-caching

tech