yeah, so you can "least squares fit" points while going through them once, pretty easily. Check this blog post about it. The first section "bilinear surface fitting" is exactly this.
https://blog.demofox.org/2017/01/02/incremental-least-squares-surface-and-hyper-volume-fitting/
It mentions a previous post that starts out with curves, while this one talks about surfaces. This is that post in case helpful for understanding better:
https://blog.demofox.org/2016/12/22/incremental-least-squares-curve-fitting/