Our InExpressionValuesExpandingExpressionVisitor rewrites the values of InExpression, for parameter and constant values. Constant values rewriting can be moved to the compilation phase - there's no reason to do this again for each query.
This would speed up queries such as .Where(x => new[] { 1, 2, 3 }.Contains(x)).