Block all unknown numbers not in my Contacts from calling and messaging on my iPhone
Yes, albeit with some trade offs. See this link for some information. If you go to Settings, hit General > Do Not Disturb > Allow Calls From and select Contacts Only. This setting applies to SMS messages as well. Hopefully this is useful.