結果がキャッシュされるとは思えません。環境変数は呼び出しごとに変更される可能性があります。そのキャッシュを自分で実装できます。
#include <map>
#include <iostream>
#include <string>
#include <stdexcept>
#include <cstdlib>
class EnvCache {
public:
    const std::string &get_env(const std::string &key) {
        auto it = cache_entries.find(key);
        if(it == cache_entries.end()) {
            const char *ptr = getenv(key.c_str());
            if(!ptr)
                throw std::runtime_error("Env var not found");
            it = cache_entries.insert({key, ptr}).first;
        }
        return it->second;
    }
    void clear() {
        cache_entries.clear();
    }
private:
    std::map<std::string, std::string> cache_entries;
};
int main() {
    EnvCache cache;
    std::cout << cache.get_env("PATH") << std::endl;
}
環境変数を変更すると、キャッシュ エントリが無効になる可能性があります。に直接マップすることもできますがconst char*、それはあなた次第です。