stmt1 is slow because assigning x to product (df["product"] = "x") first forces Pandas to store product as an object dtype column initially.
stmt1
x
product
df["product"] = "x"
df.loc[i, columns] = 0 is also slow because Pandas updates rows one by one, triggering copies.
df.loc[i, columns] = 0