The datasheet view button is available in the Library ribbon tab of the document library can’t be disabled if the list grows beyond the list view threshold. Yet if the list size does exceed the list view threshold the view loads some items. A message will be displayed that tells you there isn’t enough permission to view the entire list. You will be able to disable the datasheet view option from the ribbon in the settings for the list. There is a hard limit of 50,000 items so the view will be blocked if you have any more than that.