It does a lookup in thread-local storage so it's not zero cost. But until pthread_getspecific() starts turning up in your profile output, there's no reason to optimize for it.  Not that all calls to pthread_getspecific() are Isolate lookups, mind you.