Major problems that the world is currently confronting include global warming and the energy crisis, and the optimal absorption of solar spectrum radiation is a pivotal stage for a green future for the effective usage of solar thermal energy. The available solar absorbers are temperature sensitive and do not provide perfect absorption for a wide operation range. The major objectives of the proposed paper are to overcome these limitations and present an ultrawideband thermally stable solar absorber. The developed absorber utilizes a high melting point material comprising a Ti reflector element, a Si3N4 dielectric layer, and a pi-shaped top TiN metal layer. Within the spectral range spanning from 200 to 2500 nm, a notable average absorption rate of 97.69 % is attained. This structure has also demonstrated exceptionally under the AM1.5 conditions with a spectral absorption efficiency of 96 %. This work presents a novel optimization approach for solar absorbers, employing K-nearest neighbor (KNN) regression models to enhance design optimization by simulation time reduction with an R2 score of 0.999. The novelty resides in the absorber surface shape, utilization of cost efficient, sustainable, and thermally stable materials, as well as the KNN regression model for optimization of proposed solar absorber structure. Due to the angle and polarization insensitive characteristics, this structure can be potentially utilized for solar energy harvesting and shielding.