writing a plugin, how to disable the comment form altogether?

You can control whether comments appear by filtering the comments_open() function. Here is an example from the WordPress codex:

add_filter( 'comments_open', 'my_comments_open', 10, 2 );
function my_comments_open( $open, $post_id ) {

    $post = get_post( $post_id );

    if ( 'page' == $post->post_type )
        $open = false;

    return $open;
}