I see it is kind of tricky.
I was thinking about splitting the test period in one to calculate the optimalF and one to apply it, but it maybe not enough data for that.

The bias when optimalF=0 will be allways there somehow because those assets/algo combinations have a low PF anyways and anyone would take them away during the strategy development since there are allways some assets who do not fit into the behaviour that the strategy wants to exploit.

Another thing is when one get too optimistic optimalF. It can be reduceded so that a trade those not take all the margin as explained in the tutorial, but if the avg optimalF of all nonzero values is x and the standard desvitation of that mean is y, maybe artifitially the optimalF whichs is above that range could be reduced to that value or 2 or 3 times that value. If OptimalF is cero one avoid enter in an asset/algo which could behave good or bad. But if the optimalF is too good, then too optimistic results introduce bias.

This is something that anyone can do. But I do not know if it make sense to reduce artifitially the optimalF is this way for the too optimistic values.