How do I make a checkbox form initially have all options checked?
The actual form element values when selected are always the keys of what you have inside $options. You also can see that when inspecting the markup. So simply use '#default_value' =&gt; array_keys($options) to have all options preselected.
$form['search_block_type'] = [
  '#type' =&gt; 'checkboxes',
  '#title' =&gt; t('Content types'),
  '#description' =&gt; t('Select content types'),
  '#options' =&gt; $options,
  '#default_value' =&gt; array_keys($options),
];