If a given call to path_for relies on route_args but they are not actually present since currently executing route doesn't supply such information, defaultattrdict returns an empty string, while a call to path_for may require a non empty value, e.g. id.
Replace defaultattrdict with attrdict, this way an exception will be generated in case the requested route argument is not available. The user must explicitly update route mapping to set default route args. This should prevent unexpected path construction.
If the user code relies on mentioned above behavior, there is a way to "patch" attdict import in routing middleware.