For .NET and Python programs, it is more efficient to build a linear or quadratic expression by modifying an existing expression rather than repeatedly creating new expressions. For .NET, use the AddTerm/AddTerms methods instead of the overloaded operators. For Python, use the += or -= operators rather than creating new expressions.
For Python, try using Model.addVars() to create a sparse tupledict of variables, then use the select(), sum(), and prod() methods to iterate over only the matching variables. This is illustrated in the netflow.py example.
Finally, if you wrote your program with an older version of Gurobi that required the update() function, remove that function call and run your program with the latest version.