[python] Python idiom to return first item or None

Not sure how pythonic this is but until there is a first function in the library I include this in the source:

first = lambda l, default=None: next(iter(l or []), default)

It's just one line (conforms to black) and avoids dependencies.