Until recently if you found yourself in that situation you had no choice but to contact customer support and have them block the user for you. Apparently it's become a big enough and common enough issue that the company decided to put that power into the hands of individual users.
If you ever need to block another user on the platform here's how you go about it:
The company had this to say about the recent change:
"At Spotify, we're committed to delivering the best possible listening experience to our users. Privacy is something that is and always will be, enormously important to us and our block feature, which gives users more control, is the latest step towards that commitment."
This builds on a feature that the company added back in 2019 which allowed listeners to block any artist they didn't like and didn't want to hear music from. The company has faced a slowly growing chorus of complaints from their user base about other members stalking them online.
It took the company a while to respond but respond they did. The new feature should be available by the time you read these words.