Something along the lines of the following code should work:
from collections import Counter
def count_duplicates(path_to_data, field_to_count):
#Add the count field
data_layer = arcpy.MakeFeatureLayer_management(path_to_data, 'data')
arcpy.AddField_management(data_layer, 'COUNT', 'LONG')
arcpy.Delete_management(data_layer)
del data_layer
#Do the counting:
value_list = []
with arcpy.da.SearchCursor(path_to_data, [field_to_count]) as search_rows:
for row in search_rows:
value_list.append(row[0])
counts = Counter(value_list)
del value_list
with arcpy.da.UpdateCursor(path_to_data, [field_to_count, 'COUNT']) as update_rows:
for row in udpate_rows:
row[1] = counts[row[0]]
update_rows.updateRow(row)