How do I programmatically add ‘reviews_allowed’ to WooCommerce product?

as far as I know reviews_allowed in woocommerce is not an object term, attribute, part of the post meta or anything like that.

It’s just simply another name for comment_status in the post itself.

You can enable reviews when inserting a post using the following

$post_id = wp_insert_post(array(
    . . . . 
    'comment_status' => 'open'
));