Override buildForm() in another module
These are the two routes for the original form class:

comment.routing.yml:

comment.admin:
  path: '/admin/content/comment'
  defaults:
    _title: 'Comments'
    _form: '\Drupal\comment\Form\CommentAdminOverview'
    type: 'new'
  requirements:
    _permission: 'administer comments'

comment.admin_approval:
  path: '/admin/content/comment/approval'
  defaults:
    _title: 'Unapproved comments'
    _form: '\Drupal\comment\Form\CommentAdminOverview'
    type: 'approval'
  requirements:
    _permission: 'administer comments'


You have to alter both routes like this

  protected function alterRoutes(RouteCollection $collection) {
    if ($route = $collection-&gt;get('comment.admin')) {
      $route-&gt;setDefault('_form', '\Drupal\mymodule\Form\MyForm');
    }
  }


in a RouteSubscriber.