static array on functions.php

This is a good use case for the Object Cache:

WP_Object_Cache is WordPress’ class for caching data which may be
computationally expensive to regenerate, such as the result of complex
database queries.

You can store things in the cache with wp_cache_set() and retrieve them with wp_cache_get(). You just need to give it a key and value, as well as a group name unique to your theme/plugin or set of functionality to avoid conflicts:

function get_current_store()
{
    // Check if the current store is cached.
    $cache = wp_cache_get( 'current_store', 'my_plugin' );

    // If it is, return the cached store.
    if ( $cache ) {
        return $cache;
    }

    // Otherwise do the work to figure out $current_store;

    // Then cache it.
    wp_cache_set( 'current_store', $current_store, 'my_plugin' );

    return $current_store;
}

Now no matter how many times you run get_current_store() on a page it will only do the work of generating the current store variable once.