> What about `WHERE foo IN (?,?,?)`.
This is can be automatically handled if your ORM supports it; even a micro-ORM like Dapper does.
Otherwise my go-to solution for this if it isn't supported is to pass the collection as a user-defined table type, filled with the values. you can either use WHERE IN or join on this table variable.
EDIT: my perspective on this if from working with SQL Server and .NET. I don't know enough about Python or PHP development to comment on those.