Implement a function that returns the length of the shortest path in an unweighted 2D grid from the top-left cell (0, 0) to the bottom-right cell (m-1,n- 1). The grid contains '0' for open cells and '1' for walls; movement is allowed only in four directions (up, down, left, right). If either the start or end is blocked, or no path exists, return -1. Provide the algorithm (BFS), explain why it is appropriate, analyze time and space complexity, and discuss edge cases such as single-cell grids, large grids (up to 10^5 cells), and multiple shortest paths. Optionally extend to support diagonal moves and explain the change needed.