def stringifyOptionValue(value):
    """
    Convert option value from in-memory representation to a suitable string.

    In particular, boolean values are converted to '0' or '1'.
    """
    if value is True:
        return '1'
    elif value is False:
        return '0'
    else:
        return str(value)