<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def _convert_to_closest_type(value):
    '''
    Convert string value to it's closest non-string analog, if possible.

    :param dict value: The string value to attempt conversion on.

    :return: The converted value.
    :rtype: Union[bool, int, None, str]
    '''
    value = salt.utils.stringutils.to_bool(value.strip())

    if isinstance(value, bool):
        return value

    return salt.utils.stringutils.to_none(salt.utils.stringutils.to_num(value))