Use the return annotation to decode cached data to the correct type.
This follows the same logic FastAPI uses to JSON request bodies.
For the PickleCoder, this is a no-op as pickle already stores type
information in the serialised data.
The namespace argument is positional and will never be `None` so should
not be marked as Optional. It is always a string, and the default is
to pass in an empty string.