As the others are saying, sure, it is still a pure function.
However, let's talk about the design issues. You are right to try to do something to keep the code DRY, by putting the value in only once place. In addition, what I think also should be considered is the level of coupling that is appropriate.
Using a function gives you more flexibility to change the implementation, which is to say that the function approach offers looser coupling than a global variable.
The question is whether one needs it or not?
If consumers and the provider are in the same module, and the provider is private to the module, it is hard to argue that this level of loose coupling is necessary, due to the fact that if the provider requires upgrade from a private variable to a private method, a simple refactoring within the module can be applied to the consumers at the same time. Using a method/function before you really need could fall under YAGNI.
Even if the consumer(s) and provider are in different modules, yet the modules are versioned together (for example, you use a minifyer, so that the modules of the consumers and provider are in the same file), YAGNI may also apply.
On the other hand, if, for example, the producer is in a library or API package or module that is versioned separately from the consumer(s), then using the function may be appropriate. In that case we should be looking at longevity of the API, and principles like OCP.
(On another note, if your code is of any significant size, I would encourage the use of modules with fields and methods rather than global variables and functions.)