One way is to first join columns (columns) that require joining without substitution. This will help reduce the conditional filters that you have to build downstream. In the above example, I see that size_ais one of the following columns:
new_df = df1.merge(df2, how='inner', on='size_a')
, df2 NaN.
new_df = new_df[(new_df['size_b_x'] == new_df['size_b_y']) | new_df['size_b_y'].isnull()]
, df2 ( _y )
new_df = new_df.drop('size_b_y', 1)