Consensus-based optimization methods converge globally in mean-field law