Call the API property to activate the autofilter:
import xlwings as xw
path = r"test.xlsx"
wb = xw.Book(path)
ws = wb.sheets[0]
ws.used_range.api.AutoFilter(Field:=1)
You can also use native xlwings functions (create a table object and then set its show_autofilter to True):
import xlwings as xw
path = r"test.xlsx"
wb = xw.Book(path)
ws = wb.sheets[0]
ws.tables.add(ws.used_range, name="a_table")
ws.tables["a_table"].show_autofilter = True
# This way adds formatting in addition to the filter.