def METHOD_NAME(attach: bool=True,
                              create: bool=False,
                              title: Optional[str]=None) -> Union[bool, None]:
    """
    First this checks if output is redirected to a file and does nothing if it is. Then it tries
    to attach to the console of any parent process and if not successful it optionally creates a
    console or fails.
    If a console was found or created, it will redirect current output handles to this console.
    """
    std_out_handle = ctypes.windll.kernel32.GetStdHandle(STD_OUTPUT_HANDLE)
    if std_out_handle > 0:
        if ctypes.windll.kernel32.GetFileType(std_out_handle) == FILE_TYPE_DISK:
            # Output is being redirected to a file, do nothing
            return None
    has_console = std_out_handle > 0
    if not has_console and attach:
        # Try to attach to a parent console
        for pid in _parent_process_pids():
            if ctypes.windll.kernel32.AttachConsole(pid):
                has_console = True
                break
    if not has_console and create:
        # Try to allocate a new console
        if ctypes.windll.kernel32.AllocConsole():
            has_console = True
    if not has_console:
        return False
    if title:
        # Set the console title
        ctypes.windll.kernel32.SetConsoleTitleW(title)
    # Reopen Pythons console input and output handles
    conout = open('CONOUT$', 'w')
    sys.stdout = conout
    sys.stderr = conout
    logs.set_stream_output(conout)
    sys.stdin = open('CONIN$', 'r')
    return True