The cost is cheaper, but not zero. With a library the LLM knows how to use means it doesn't need to write a bajillion tests and tokens for all of the wheels it reinvented. The same reasoning applies to the standard library that comes with the programming language it uses, as well as the programming language itself.