WinError 32 error when trying to delete shapefiles with QGIS python

On Windows you must stop using and close the file before you can delete it. So QgsVectorFileWriter.deleteShapeFile(f) will work, once you have let go of the file which is still being used by shapelayer.

The QgsVectorLayer is a wrapper around an OGR C++ call so the easiest way to dispose of it is to set it to None.

clipped_soilpoly = get_data(clipped_folder, ".shp") # makes a list of all the .shps
for f in clipped_soilpoly:
    shapelayer = QgsVectorLayer(f,"clipped_poly")
    rowcount = shapelayer.featureCount()

    if rowcount < 1:
        shapelayer = None

should work.