Using pre_get_posts, how to target the REST API, only?

Yes.

So long as the code you’re running happens after parse_request – which pre_get_posts does. (See https://codex.wordpress.org/Plugin_API/Action_Reference#Actions_Run_During_a_Typical_Request)

Then you will have a nice constant to use: REST_REQUEST

Something like

if( defined( 'REST_REQUEST' ) && REST_REQUEST ) {
    // ...do RESTy things
}

will do the trick.

See /wp-includes/rest-api.php