How do I detect whether any contact forms have been created?
You can use the D8 config factory interface to retrieve multiple contact form config keys and their corresponding config entities:
$contact_form_keys = \Drupal::configFactory()-&gt;listAll('contact.form');
$contact_form_configs = \Drupal::configFactory()-&gt;:loadMultiple($contact_form_keys);