Using deque for composing a string from 2 alternating stacks
There is no need to read the whole string into a deque. Just iterate over the strings using iterators. The only gotcha is handling the fact that either of the strings can be empty at the beginning and that one can be exhausted before the other.

def _morgan(a, b):
    a, b = iter(a), iter(b)
    try:
        x = next(a)
    except StopIteration:
        yield from b
        return
    try:
        y = next(b)
    except StopIteration:
        yield x
        yield from a
        return
    while True:
        if x &lt;= y:  # `&lt;=` because that's what `min` does
            yield x
            try:
                x = next(a)
            except StopIteration:
                yield y
                yield from b
                return
        else:
            yield y
            try:
                y = next(b)
            except StopIteration:
                yield x
                yield from a
                return


def morgan(a, b):
    return "".join(_morgan(a, b))


Note that both the original strings and the resulting string still need to fit into memory for this to work. If you only need to iterate over the resulting string, use only the private function. In that case the original strings still need to fit into memory, unless you also have them as generators (e.g. by streaming the contents from the URLs):

import requests

def stream(url, chunk_size=1000):
    with requests.get(url, stream=True) as r:
        for chunk in r.iter_content(chunk_size=chunk_size, decode_unicode=True):
            yield from iter(chunk)

if __name__ == "__main__":
    a = stream("https://pastebin.com/raw/pebMbcA6")
    b = stream("https://pastebin.com/raw/bwNEqJcr")
    c = _morgan(a, b)
    while (chunk := "".join(islice(c, 1000))):
        print(chunk, end='')
    print()


This works on my machine with the given strings, but so does the morgan function I defined above.



Note that you need Python 3.8+ for the walrus operator :=. With earlier Python versions it is slightly more verbose:

 if __name__ == "__main__":
    a = stream("https://pastebin.com/raw/pebMbcA6")
    b = stream("https://pastebin.com/raw/bwNEqJcr")
    c = _morgan(a, b)
    chunk = "".join(islice(c, 1000))
    while chunk:
        print(chunk, end='')
        chunk = "".join(islice(c, 1000))
    print()