Use the parameter 'fields'
:
$pages = get_posts(
array(
'post_type' => 'page',
'meta_key' => '_wp_page_template',
'meta_value' => 'product.php',
'fields' => 'ids'
)
);
Not tested, but it should fetch just the IDs.