This paper proposes an Unified Path Planner (UPP) that resolves the tradeoff between optimality and safety in path planning for autonomous robots. UPP is a graph-search-based algorithm that dynamically balances path length and obstacle spacing using a modified heuristic function that incorporates dynamic safety costs. We establish a theoretical suboptimality bound and demonstrate that the safety-optimality ratio can be tuned via tunable parameters. Extensive simulations demonstrate that UPP generates suboptimal paths with a high success rate and only a marginal increase in cost compared to the conventional A* method, while guaranteeing a safety margin comparable to that of a traditional Voronoi planner. Furthermore, a hardware implementation using TurtleBot verifies the UPP's ability to generate safe and suboptimal paths in complex environments.