Yeah, I agree that running eval_const_expressions here is expensive. Maybe we can just do the reverse transformation in create_bitmap_scan_plan against what we do for boolean index in match_boolean_index_clause?
Following this idea, I come up with v2 patch. Is this the right direction to go?
Update with v3 patch, nothing changes except fixes a test failure spotted by cfbot.