docs: def clean_path(base_path):
      """
      This function cleans a file system path in terms of removing all not allowed characters of each path element.
      A path element is an element of a path between the path separator of the operating system.
      
      :param base_path: the path to be cleaned
      :return: the clean path
      """
      path_elements = base_path.split(os.path.sep)
      reduced_path_elements = [clean_path_element(elem, max_length=255) for elem in path_elements]
      if not all(path_elements[i] == elem for i, elem in enumerate(reduced_path_elements)):
          # logger.info("State machine storage path is reduced")
          base_path = os.path.sep.join(reduced_path_elements)
      return base_path