Get the first item in a sequence that matches a condition
This is a use case for the walrus operator :=, which was introduced in Python 3.8. It allows you to write 1) without repeating yourself:
runner = next(
    r
    for caller in inspect.stack()
    if isinstance(r := caller[0].f_locals.get(&quot;runner&quot;), AbstractRunner)
)

Whether or not you find this more readable or if this is too much nestedness in the if part is up to personal taste.