This did not work in python3. Since the Variable was passed by reference, all lambdas ended up refering to the same, last, element in columns.
This did the trick for me:
for col in columns:
treeview.heading(col, text=col, command=lambda _col=col: \
treeview_sort_column(treeview, _col, False))