This might not meet your needs but it can be done from the Support menu under api4 explorer (but not api3). Choose activity - get, and then for the where clause pick assignees.id Is Null. Then click execute. Note on a stock install the screen will look weird but it functions.
From the db schema https://doc.symbiotic.coop/dev/civicrm/latest/schema/tables/civicrm_sms_provider.html
It looks like you might be after the sms_provider_id from the civicrm_mailing table, or sms_provider_id from the civicrm_action_schedule table.