MUCH faster `last` for non-sequences by using a deque

10x faster than the replaced code.