Remove a user from user-restricted access property for all entries

from this, I can restrict to show which entries are visible to a certain users. In case I need to remove a certain user from visible_by for all entries, how can I achieve this? do I need to search first and batch update for all entries?

Correct, you would need to update the index’s record with your new visible_by values. You could either search on the index and update the values on the index, or if you were syncing this information from another system, as this information was updated it would’ve sent the updated information to the index.

If you wanted to just update the index, I would suggest using the partialUpdateObject method as described here.