def convert_value(val):
    """
    Convert string to the most appropriate type, one of: bool, str, int, None or float

    :param str val: the string to convert
    :return bool | str | int | float | None: converted string to the most appropriate type
    """
    if not isinstance(val, str):
        try:
            val = str(val)
        except:
            raise ValueError("The input has to be of type convertible to 'str', got '{}'".format(type(val)))

    if isinstance(val, bool):
        return val
    if isinstance(val, str):
        if val == 'None':
            return None
        try:
            float(val)
        except ValueError:
            return val
        else:
            try:
                int(val)
            except ValueError:
                return float(val)
            else:
                return int(val)