We have 9 buttons and need to test all combinations with 3 of those buttons. 93 is 729, utterly trivial to bruteforce:

def parse_btn(w):
    if w[0] != '[' or w[-1] != ']':
        assert 0, repr(w)
    w = w[1:-1]
    if w == 'oct':
        return lambda x: int(oct(x)[2:])
    elif w == 'bksp':
        return lambda x: x // 10
    elif w[0] == '*':
        y = int(w[1:])
        return lambda x: x * y
    elif w[0] == '/':
        y = int(w[1:])
        return lambda x: x // y
    elif '->' in w:
        y, z = (str(int(x)) for x in w.split('->'))
        return lambda x: int(str(x).replace(y, z))
    else:
        y = int(w)
        return lambda x: (x * 10) + y

def comb(s, x, buttons, n):
    for b in buttons:
        y = (b)(x)
        if n > 1: comb(s, y, buttons, n - 1)
        s.add(y)

def combinations(buttons, n):
    buttons = [*map(parse_btn, buttons)]
    s = set()
    comb(s, 0, buttons, n)
    return s

print(sum(combinations(open('input.txt').read().split(), 3)))

This solution doesn't work for part 2, but I already realized we just have to detect "cycles": if a combination produces a result we already have, there is no point in trying any combinations with that result again.

def parse_btn(w):
    if w[0] != '[' or w[-1] != ']':
        assert 0, repr(w)
    w = w[1:-1]
    if w == 'oct':
        return lambda x: int(oct(x)[2:])
    elif w == 'bksp':
        return lambda x: x // 10
    elif w[0] == '*':
        y = int(w[1:])
        return lambda x: x * y
    elif w[0] == '/':
        y = int(w[1:])
        return lambda x: x // y
    elif '->' in w:
        y, z = (str(int(x)) for x in w.split('->'))
        return lambda x: int(str(x).replace(y, z))
    else:
        y = int(w)
        return lambda x: (x * 10) + y

def combinations(buttons, n):
    buttons = [*map(parse_btn, buttons)]
    cur, new, nnew = {0}, {0}, set()
    while new and n >= 0:
        cur |= new
        nnew.clear()
        for x in new:
            for b in buttons:
                y = (b)(x)
                if y <= 9999 and y not in cur:
                    nnew.add(y)
        nnew, new = new, nnew
        n -= 1
    return cur

print(sum(combinations(open('input.txt').read().split(), 3)))
print(sum(combinations(open('input.txt').read().split(), 1e100)))