Automatic broadcasting is a fairly new Octave feature that generates bsxfun wherever there is a measurement mismatch between single-point and non-single measurements.
In this case
X_poly = X. ^ powers;
replaced by
X_poly = bsxfun (@power, X, powers);
This is a completely legal octave behavior, and it seems that this is exactly what you want to do, so you do not need to change it at all.
The warning is because Matlab does not support automatic broadcasting, so they want to remind you that if you try to run this code in Matlab, it will fail.
Moreover, a common practice among many Octave programmers is to rely mainly on size mismatch as a way to detect errors in their program. I even once took a machine learning class, where a professor said to the whole class, "If all sizes match, then this is probably right." This is terrible, scary advice and a surefire way to make sure that everyone does not do their homework, but it reflects the general approach of many researchers to writing Matlab / Octave programs.
For this reason, introducing automatic broadcasting without any warning can cause trouble tracking if you are not in the habit of making explicit statements about your function entries.
If you want to get rid of the warning, you can simply add
warning("off", "Octave:broadcast");
to your code.
If you want to maintain better compatibility with Matlab or just don't use automatic broadcasting and prefer to have an octave error to help isolate errors, you can add
warning ("error", "Octave:broadcast");
instead.