How to benchmark query parsing & planning in Postgres?
It is not caching the actual prepared plans (unless you are using prepared statements).  But it does cache all the metadata it needs to look up in order to come up with the plan.  So the original planning time includes the time it took to read in all of that metadata.

If you wish to defeat the caching for experimental purposes, the simplest way would be to simply close psql and re-open it between every experiment.

For instrumentation, You can time each step of the parse-plan-execute process using log_statement_stats or its kin.  You can also set client_min_messages = log so that those reported statistics show up directly on the psql screen, rather than having to go fetch them from the server log file.  You will need to be a superuser to set either of those.