Can the notion of "squaring" be extended to other shapes?
Actually, there are so-called polygonal numbers of all sizes. The triangle numbers are 1, 3, 6, 10, 15, ... . They can be arranged in the shape of a (filled in) equilateral triangle. They are formed as
1, 1+2, 1+2+3, ... , so the n'th triangle number is $T_n = n(n+1)/2$.
Similarly, the square numbers can be formed (just using addition) as
1, 1+3, 1+3+5, 1+3+5+7, ..., and the n'th square number is (of course) $S_n = n^2$.
The pentagonal numbers, which form regular pentagons (including the interior points) are 1, 5, 12, 22, ..., which are formed by
1, 1+4, 1+4+7, 1+4+7+10, ... .
And if you study the question of "Which triangle numbers are also square numbers?", you'll be lead to solving the Pell equation $X^2 - 2Y^2 = 1$ and finding infinitely many solutions to $T_n=S_m$, the smallest non-trivial solution being $T_8=S_6=36$. OTOH, I'm not sure if it's known whether there are infinitely many numbers that are simultaneously triangular, square, and pentagonal, or indeed whether there are any such numbers (other than 1).
If you are interested, the area of a regular $n$-polygon with side length $l$ is $$ \frac{nl^2}{4}\cot\frac{\pi}{n} $$ Squares/rectangles are fundamental as they are the products of two intervals (set-theoretically): $$ [a,b] \times [c,d] $$ It then becomes natural to assign this square/rectangle an area of $(d-c)(b-a)$. Other shapes cannot be expressed in this form.
I think you have the motivation backwards. The function $f(x) = x^2$ is a very useful function in its own right. In fact, it is one of a whole family of functions:
$$1, x, x^2, x^3, x^4, x^5, x^6, \ldots$$
Mathematicians have thought about these functions (called polynomials) for centuries. In fact, the field of classical algebraic geometry is basically all about solving equations involving polynomials.
Now, it just so happens that $x^2$ has the special property that it is equal to the area of the square with side length $x$. Mathematicians thought this was a pretty nice property, so they decided to name this function the "square" function. Likewise, $x^3$ is the "cube" function, and if we lived in higher dimensional space, we would likely have a geometric name for the function $x^4$ as well.
Summary: The function $x^2$ came first, and the name "squaring function" came second.
There is also some geometrical justification coming from the physical world/space we live in. Squares have all their angles $90^\circ$. Compared to other $2\pi/n$ the angle $2\pi/4$ occurs naturally. Corners of walls of buildings (unless you work in US defence establishment whose name starts with P). have this angle. Road junctions angle of turns are preferred this way.
Among all shapes circle is the most significant. Square has a special relationship with the circle in the following way: The ratio of areas of a circle of radius $r$ with a square of side length $r$ seems to come up all over calculus. (as opposed to trianglular area's ratio)
Regarding using triangles to model 2nd powering, or any m x n, check here: https://youtu.be/2B1XXV2Eoh8
The idea extends to a tetrahedron as a model of 3rd powering. http://www.rwgrayprojects.com/synergetics/s09/figs/f9001.html
Note that numeric results don't change, only the shapes used to represent the results. To the best of my knowledge, the author making the most use of this alternative model was R. Buckminster Fuller.