How to disable USB mass-storage in STLink on Nucleo?
In the recent STLinkUpgrade 3.3.0 I can see checkbox "Change Type" offering "Debug + Mass storage + VCP" or "Debug + VCP". Seems like the way to go.

To download the latest and greatest version: https://www.st.com/en/development-tools/stsw-link007.html

Just click on the "Get Software".