According to general relativity (Friedman metric), the overall curvature of the universe is determined by the average energy density of the universe. The curvature can be positively curved like a sphere, negatively curved like a saddle, or Euclidean ‘flat’. In order to be flat, the universe has to be exactly at what is called the critical energy density, a very precise initial condition of the universe. Since, as other answerers have said, measurements show - within limits of accuracy - that the universe is Euclidean flat, then it is very difficult to explain that precise initial condition. This is one of the reasons that the inflationary model was proposed - extreme inflation can inflate the universe to a size where it can be negatively or positively curved, but the curvature is not detectable within the limits of our measurements. This does not mean that the precise initial conditions for flatness didn’t exist, it just means that we have no good explanation for it.
It should be noted that there are two basic types of curvature, intrinsic and extrinsic. General relativity is a theory about the intrinsic curvature of the universe, a curvature that can be detected through measurement confined to the dimensions within the universe. This is what we can detect by measuring properties of geometric objects such as triangles and spheres. Extrinsic curvature is curvature that can be detected from an embedding space. There are many types of extrinsic curvature that still result in flat Euclidean measurements from within the universe. A prime example of that is a 3-torus which is intrinsically flat but has extrinsic curvature. This gets around a huge conceptual issue with a flat universe (which has to be unbounded which implies infinite) since a three torus is intrinsically flat, but still bounded and therefore finite. Unfortunately, a 3-torus is topologically different in that it is multiply-connected (has a ‘hole’) and General Relativity is not a topological theory so it really can’t tell us. There have been tests to see if the universe is a 3-torus ( like a 2-d torus, light from an object could come from different directions but space would still look flat), but those have come up empty within measurement accuracy. Still possible though.
So, there are various intrinsic and extrinsic shape options that cannot be eliminated at this point, but so far all measurements indicate the universe is Euclidean flat, therefor unbounded/infinite, and topologically simply-connected.