Replaced overload with Union type in os/path module

Resolves #436