Rewrite mk_plate_scoring_functions in a such a way that can create all temporary objects during the first call.
E.g.,
scoring_f <- mk_plate_scoring_functions(
row = "row", column = "column", group = "Sex"
)
bc <- optimize_design(bc, scoring = scoring_f, max_iter = 100)