os.path.commonprefix is suitable for any strings