Avoid colinearity: "if_binary" versus "first"

file: 03_categorical_pipeline_column_transformer.ipynb

If I understand the OneHotEncoder() documentation correctly, "if_binary" drops a column only when there is two categories in a feature to one-hot encode.
Wouldn’t "first" be even better to avoid colinearity?

(Well I tried in the document: scores obtains with crossed-validation are hardly (almost not at all) different.)

Your analysis is right regarding the usage of "first". In practice, you might not see so much the difference because you are usually using regularized model (Ridge, Lasso, LogisticRegression with some penalty). So the collinearity will have an effect on the optimization problem and specifically when you try to interpret the coefficient (see this example). However, it might not have a huge impact on the score itself because the regularization avoid the failure mode.