def term2str(term):
    """Convert a term argument to string.

    :param term: the term to convert
    :type term: Term | None | int
    :return: string representation of the given term where None is converted to '_'.
    :rtype: str
    """
    if term is None:
        return '_'
    elif type(term) is int:
        if term >= 0:
            return 'A%s' % (term + 1)
        else:
            return 'X%s' % (-term)
    else:
        return str(term)